Run the example in file svm_test.m
SVM_PEGASOS Create SVM model with PEGASOS solver
matrix x(mxn) contains the training set for m tests and n features
with the corresponding labels vector y(mx1). The SMO solver user the
constants lambda, tol(tolerance) and T (max. Iterations). The choice
of the kernel is defined in type ('l' for linear, 'r for rbf, 'p' for
polynomial and 's' for sigmoid). Depending on the choice of kernel the
additionnal parameter will be used (gamma, offset and power).
The training result will be given as the alpha coefficients and the t
iterations.
LF_SVM_SMO Predict labels from SVM model with PEGASOS solver
matrix xp(mpxn) contains the testing set for n features
and mp tests. The SVM model consists of the alpha coefficients,
the training set matrix x(mxn), the labels vector y(mx1),
lamdba and the T iterations. The choice of the kernel is defined in
type ('l' for linear, 'r for rbf, 'p' for polynomial and 's' for
sigmoid). Depending on the choice of kernel the additionnal parameter
will be used (gamma, offset and power).
The prediction result will be given as the labels
Implementation from: Shalev-Shwartz, Shai, et al. "Pegasos: Primal
estimated sub-gradient solver for svm." Mathematical programming 127.1
(2011): 3-30.
引用格式
Ivan Tinjaca (2024). Primal estimated sub-gradient solver (PEGASOS) for SVM (https://www.mathworks.com/matlabcentral/fileexchange/79343-primal-estimated-sub-gradient-solver-pegasos-for-svm), MATLAB Central File Exchange. 检索来源 .
MATLAB 版本兼容性
平台兼容性
Windows macOS Linux标签
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!