plotLSVM {mistral}R Documentation

plot of LSVM

Description

Make a plot of the data and the LSVM classifier

Usage

  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


# 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)


[Package mistral version 2.2.2 Index]