plotLSVM: plot of LSVM

Description

Make a plot of the data and the LSVM classifier

Usage

1
2
3
4
5
6
  plotLSVM(X,
          Y,
          A.model.lsvm,
          hyperplanes = FALSE,
          limit.state.estimate = TRUE,
          convexity)

Arguments

X

a matrix containing the data sets

Y

a vector containing -1 or +1 that reprensents the class of each elements of X.

A.model.lsvm

a matrix containing the parameters of all hyperplanes.

hyperplanes

A boolean. If TRUE, plot the hyperplanes obtained.

limit.state.estimate

A boolean. If TRUE, plot the estimate of the limit state.

convexity

Either -1 if the set of data associated to the label "-1" is convex or +1 otherwise.

Details

plotLSVM makes a plot of the data as well as the estimate limit state and the hyperplanes involved in this construction.

Note

This function is useful only in dimension 2.

Author(s)

Vincent Moutoussamy

References

See Also

LSVM modelLSVM

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# A limit state function
f <- function(x){  sqrt(sum(x^2)) - sqrt(2)/2 }

# Creation of the data sets

n <- 200
X <- matrix(runif(2*n), nrow = n)
Y <- apply(X, MARGIN = 1, function(w){sign(f(w))})

## Not run: 
  model.A <- modelLSVM(X,Y, convexity = -1)
  plotLSVM(X, Y, model.A, hyperplanes = FALSE, limit.state.estimate = TRUE, convexity = -1)

## End(Not run)

Questions? Problems? Suggestions? or email at ian@mutexlabs.com.

All documentation is copyright its authors; we didn't write any of that.