Learn R Programming

gmum.r (version 0.2.1)

plot.Rcpp_SVMClient: Plot SVM object

Description

Plots trained svm data and models disciriminative

Usage

"plot"(x, X = NULL, mode = "normal", cols = c(1, 2), radius = 3, radius.max = 10, ...)

Arguments

x
Trained SVM object
X
Optional new data points to be predicted and plotted in one of the following formats: data.frame, data.matrix; default: NULL
mode
Which plotting mode to use as string, available are:
  • 'normal' - default mode, plots data in cols argument and a linear decision boundry in available
  • 'pca' - preforms PCA decomposition and draws data in a subspace of first 2 dimensions from the PCA
  • 'contour' - countour plot for non-linear kernels
cols
Data dimensions to be plotted as vector of length 2, default: c(1,2)
radius
Radius of the plotted data points as float, default: 3
radius.max
Maximum radius of data points can be plotted, when model is trained with example weights as float, default: 10
...
other arguments not used by this method.

Examples

Run this code
## Not run: 
# # here we ause svm is a trained SVM model
# plot(svm)
# plot(svm, X=x, cols=c(1,3))
# plot(svm, mode="pca", radius=5)
# ## End(Not run)

Run the code above in your browser using DataLab