aboutsummaryrefslogtreecommitdiff
path: root/man/plot.gensvm.Rd
blob: e28a108540c98fb6bb9eb023d0cb86182881a180 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/plot.gensvm.R
\name{plot.gensvm}
\alias{plot.gensvm}
\title{Plot the simplex space of the fitted GenSVM model}
\usage{
\method{plot}{gensvm}(fit, x, y.true = NULL, with.margins = TRUE,
  with.shading = TRUE, with.legend = TRUE, center.plot = TRUE, ...)
}
\arguments{
\item{fit}{A fitted \code{gensvm} object}

\item{x}{the dataset to plot}

\item{y.true}{the true data labels. If provided the objects will be colored 
using the true labels instead of the predicted labels. This makes it easy to 
identify misclassified objects.}

\item{with.margins}{plot the margins}

\item{with.shading}{show shaded areas for the class regions}

\item{with.legend}{show the legend for the class labels}

\item{center.plot}{ensure that the boundaries and margins are always visible 
in the plot}

\item{...}{further arguments are ignored}
}
\value{
returns the object passed as input
}
\description{
This function creates a plot of the simplex space for a fitted 
GenSVM model and the given data set, as long as the dataset consists of only 
3 classes.  For more than 3 classes, the simplex space is too high 
dimensional to easily visualize.
}
\examples{
x <- iris[, -5]
y <- iris[, 5]

# train the model
fit <- gensvm(x, y)

# plot the simplex space
plot(fit, x)

# plot and use the true colors (easier to spot misclassified samples)
plot(fit, x, y.true=y)

# plot only misclassified samples
x.mis <- x[predict(fit, x) != y, ]
y.mis.true <- y[predict(fit, x) != y]
plot(fit, x.mis)
plot(fit, x.mis, y.true=y.mis.true)

}
\author{
Gerrit J.J. van den Burg, Patrick J.F. Groenen \cr
Maintainer: Gerrit J.J. van den Burg <gertjanvandenburg@gmail.com>
}
\references{
Van den Burg, G.J.J. and Groenen, P.J.F. (2016). \emph{GenSVM: A Generalized 
Multiclass Support Vector Machine}, Journal of Machine Learning Research, 
17(225):1--42. URL \url{http://jmlr.org/papers/v17/14-526.html}.
}