Pegasos solver for linear (binary) support vector machines. More...
#include <shark/Algorithms/Pegasos.h>
Static Public Member Functions | |
| template<class WeightType > | |
| static std::size_t | solve (LabeledData< VectorType, unsigned int > const &data, double C, WeightType &w, std::size_t batchsize=1, double varepsilon=0.001) |
| Solve the primal SVM problem. | |
Static Protected Member Functions | |
| static bool | lg (VectorType const &x, unsigned int y, double f, VectorType &gradient) |
Pegasos solver for linear (binary) support vector machines.
|
inlinestaticprotected |
Definition at line 161 of file Pegasos.h.
Referenced by shark::Pegasos< VectorType >::solve().
|
inlinestatic |
Solve the primal SVM problem.
In addition to "standard" Pegasos this solver checks a meaningful stopping criterion.
The function returns the number of model predictions during training (this is comparable to SMO iterations).
| data | training data |
| C | SVM regularization parameter |
| w | weight vector |
| batchsize | number of samples in each gradient estimate |
| varepsilon | solution accuracy (factor by which the primal gradient should be reduced) |
Definition at line 65 of file Pegasos.h.
References shark::random::discrete(), shark::Pegasos< VectorType >::lg(), shark::LabeledData< InputT, LabelT >::numberOfElements(), and SHARK_ASSERT.