Description Usage Arguments Details Value Warning Note Author(s) References See Also Examples
The SVM has a regularization or cost parameter C, which controls the amount by which points overlap their soft margins. Typically either a default large value for C is chosen (allowing minimal overlap), or else a few values are compared using a validation set. This algorithm computes the entire regularization path (i.e. for all possible values of C for which the solution changes), with a cost a small (~3) multiple of the cost of fitting a single model.
1 2 | svmpath(x, y, K, kernel.function = poly.kernel, param.kernel = 1, trace,
plot.it, eps = 1e-10, Nmoves = 3 * n, digits = 6, lambda.min = 1e-04,ridge=0, ...)
|
x |
the data matrix (n x p) with n rows (observations) on p variables (columns) |
y |
The "-1,+1" valued response variable. |
K |
a n x n kernel matrix, with default value |
kernel.function |
This is a user-defined function. Provided are
|
param.kernel |
parameter(s) of the kernels |
trace |
if |
plot.it |
a flag indicating whether a plot should be produced
(default |
eps |
a small machine number which is used to identify minimal step sizes |
Nmoves |
the maximum number of moves |
digits |
the number of digits in the printout |
lambda.min |
The smallest value of |
ridge |
Sometimes the algorithm encounters singularities; in this
case a small value of ridge, around 1e-12, can help. Default is |
... |
additional arguments to some of the functions called by
svmpath. One such argument that can be passed is |
The algorithm used in svmpath()
is described in detail in
"The Entire Regularization Path for the Support Vector Machine" by
Hastie, Rosset, Tibshirani and Zhu (2004). It exploits the fact that
the "hinge" loss-function is piecewise linear, and the penalty term is
quadratic. This means that in the dual space, the lagrange multipliers
will be pieceise linear (c.f. lars
).
a "svmpath" object is returned, for which there are print, summary, coef and predict methods.
Currently the algorithm can get into machine errors if
epsilon
is too small, or if lambda.min
is too
small. Increasing either from their defaults should make the problems
go away, by terminating the algorithm slightly early.
This implementation of the algorithm does not use updating to solve the "elbow" linear equations. This is possible, since the elbow changes by a small number of points at a time. Future version of the software will do this. The author has encountered numerical problems with early attempts at this.
Trevor Hastie
The paper http://www-stat.stanford.edu/~hastie/Papers/svmpath.pdf, as well as the talk http://www-stat.stanford.edu/~hastie/TALKS/svmpathtalk.pdf.
print, coef, summary, predict, and FilmPath
1 2 3 4 5 |
Loaded svmpath 0.955
1: Obs 1 ->E lambda = 2.607316 Sum Eps = 4.35 Elbow = 2 Error = 2
1: Obs 11 ->E lambda = 2.607316 Sum Eps = 4.35 Elbow = 2 Error = 2
2: Obs 6 L->E lambda = 1.981148 Sum Eps = 4.14 Elbow = 3 Error = 2
3: Obs 11 E->R lambda = 1.173511 Sum Eps = 4.14 Elbow = 2 Error = 2
4: Obs 10 L->E lambda = 0.960737 Sum Eps = 3.73 Elbow = 3 Error = 2
5: Obs 1 E->R lambda = 0.705765 Sum Eps = 3.73 Elbow = 2 Error = 2
6: Obs 4 L->E lambda = 0.460165 Sum Eps = 3.1 Elbow = 3 Error = 1
7: Obs 10 E->R lambda = 0.194509 Sum Eps = 3.1 Elbow = 2 Error = 1
8: Obs 8 L->E lambda = 0.101745 Sum Eps = 2.27 Elbow = 3 Error = 1
9: Obs 4 E->R lambda = 0.0676586 Sum Eps = 2.27 Elbow = 2 Error = 1
10: Obs 3 L->E lambda = 0.0273655 Sum Eps = 0.83 Elbow = 3 Error = 0
11: Obs 8 E->R lambda = 0.0128392 Sum Eps = 0.83 Elbow = 2 Error = 0
12: Obs 9 L->E lambda = 0.00750737 Sum Eps = 0 Elbow = 3 Error = 0
1: Obs 1 ->E lambda = 2.607316 Sum Eps = 4.35 Elbow = 2 Error = 2
1: Obs 11 ->E lambda = 2.607316 Sum Eps = 4.35 Elbow = 2 Error = 2
2: Obs 6 L->E lambda = 1.981148 Sum Eps = 4.14 Elbow = 3 Error = 2
3: Obs 11 E->R lambda = 1.173511 Sum Eps = 4.14 Elbow = 2 Error = 2
4: Obs 10 L->E lambda = 0.960737 Sum Eps = 3.73 Elbow = 3 Error = 2
5: Obs 1 E->R lambda = 0.705765 Sum Eps = 3.73 Elbow = 2 Error = 2
6: Obs 4 L->E lambda = 0.460165 Sum Eps = 3.1 Elbow = 3 Error = 1
7: Obs 10 E->R lambda = 0.194509 Sum Eps = 3.1 Elbow = 2 Error = 1
8: Obs 8 L->E lambda = 0.101745 Sum Eps = 2.27 Elbow = 3 Error = 1
9: Obs 4 E->R lambda = 0.0676586 Sum Eps = 2.27 Elbow = 2 Error = 1
10: Obs 3 L->E lambda = 0.0273655 Sum Eps = 0.83 Elbow = 3 Error = 0
11: Obs 8 E->R lambda = 0.0128392 Sum Eps = 0.83 Elbow = 2 Error = 0
12: Obs 9 L->E lambda = 0.00750737 Sum Eps = 0 Elbow = 3 Error = 0
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.