Learn R Programming

mistral (version 2.2.2)

plotLSVM: 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.

Author

Vincent Moutoussamy

Details

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

References

  • R.T. Rockafellar:
    Convex analysis
    Princeton university press, 2015.

  • N. Bousquet, T. Klein and V. Moutoussamy :
    Approximation of limit state surfaces in monotonic Monte Carlo settings
    Submitted .

See Also

LSVM modelLSVM

Examples

Run this code

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

if (FALSE) {
  model.A <- modelLSVM(X,Y, convexity = -1)
  plotLSVM(X, Y, model.A, hyperplanes = FALSE, limit.state.estimate = TRUE, convexity = -1)
}

Run the code above in your browser using DataLab