File Exchange

image thumbnail

Primal estimated sub-gradient solver (PEGASOS) for SVM

version 1.0.1 (3.86 KB) by Ivan Tinjaca
SVM_PEGASOS Create SVM model with PEGASOS solver and different Kernels (linear, rbf, polynomial, sigmoid)

2 Downloads

Updated 20 Aug 2020

View Version History

View License

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.

Cite As

Ivan Tinjaca (2020). 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. Retrieved .

Comments and Ratings (0)

MATLAB Release Compatibility
Created with R2020a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!