Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

plot

plot method for support vector object


Description

Plot a binary classification support vector machine object. The plot function returns a contour plot of the decision values.

Usage

## S4 method for signature 'ksvm'
plot(object, data=NULL, grid = 50, slice = list())

Arguments

object

a ksvm classification object created by the ksvm function

data

a data frame or matrix containing data to be plotted

grid

granularity for the contour plot.

slice

a list of named numeric values for the dimensions held constant (only needed if more than two variables are used). Dimensions not specified are fixed at 0.

Author(s)

See Also

Examples

## Demo of the plot function
x <- rbind(matrix(rnorm(120),,2),matrix(rnorm(120,mean=3),,2))
y <- matrix(c(rep(1,60),rep(-1,60)))

svp <- ksvm(x,y,type="C-svc")
plot(svp,data=x)

kernlab

Kernel-Based Machine Learning Lab

v0.9-29
GPL-2
Authors
Alexandros Karatzoglou [aut, cre], Alex Smola [aut], Kurt Hornik [aut], National ICT Australia (NICTA) [cph], Michael A. Maniscalco [ctb, cph], Choon Hui Teo [ctb]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.