Squared Radius-Margin-Quotient. More...
#include <RadiusMargin.h>
Public Member Functions | |
| RadiusMargin () | |
| Constructor. | |
| ~RadiusMargin () | |
| Destructor. | |
| double | error (Model &model, const Array< double > &input, const Array< double > &target) |
| Computes the radius margin quotient. | |
| double | errorDerivative (Model &model, const Array< double > &input, const Array< double > &target, Array< double > &derivative) |
| Computes the radius margin quotient and its derivatives as proposed by Chapelle, Vapnik, Bousquet and Mukherjee in "Choosing Multiple Parameters for Support Vector Machines", sections 6.1 and 6.2. | |
| void | setMaxIterations (SharkInt64 maxiter=-1) |
| set the maximum number of iterations for the quadratic program solver | |
| SharkInt64 | iterations () |
| return the number of iterations last used by the quadratic program solver | |
Protected Member Functions | |
| double | solveProblems (SVM *pSVM, double Cplus, double Cminus, const Array< double > &input, const Array< double > &target, Array< double > &alpha, Array< double > &beta, bool norm2) |
Helper function calling the quadratic problem solver to obtain the coefficients and . | |
Protected Attributes | |
| SharkInt64 | maxIter |
| maximum number of C_Solver iterations | |
| SharkInt64 | iter |
| last number if C_Solver iterations | |
Squared Radius-Margin-Quotient.
is a well known quantity in statistical learning theory which can be turned into a generalization bound after normalization. Its minimization has been proposed for SVM model selection.
vector w.r.t. C is hard to compute (in fact, it involves the inverse of the matrix
which is considered to be too large to fit into memory), the errorDerivative member only computes the derivative w.r.t the kernel parameters. However, if the 2-norm slack penalty formuation is used, C can be interpreted as a kernel matrix parameter and the derivative can be computed easily.Definition at line 85 of file RadiusMargin.h.
| RadiusMargin::RadiusMargin | ( | ) |
| RadiusMargin::~RadiusMargin | ( | ) |
Destructor.
Definition at line 47 of file RadiusMargin.cpp.
| double RadiusMargin::error | ( | Model & | model, | |
| const Array< double > & | input, | |||
| const Array< double > & | target | |||
| ) | [virtual] |
Computes the radius margin quotient.
Implements ErrorFunction.
Definition at line 52 of file RadiusMargin.cpp.
References C_SVM::get_Cminus(), C_SVM::get_Cplus(), MetaSVM::getSVM(), i, C_SVM::is2norm(), and solveProblems().
| double RadiusMargin::errorDerivative | ( | Model & | model, | |
| const Array< double > & | input, | |||
| const Array< double > & | target, | |||
| Array< double > & | derivative | |||
| ) | [virtual] |
Computes the radius margin quotient and its derivatives as proposed by Chapelle, Vapnik, Bousquet and Mukherjee in "Choosing Multiple Parameters for Support Vector Machines", sections 6.1 and 6.2.
Please note that in the 1-norm slack penalty case the derivative w.r.t. C is returned as zero, which is actually not the case. The computation of this derivative would require the inversion of the kernel gram matrix restricted to the support vectors, which is considered infeasible. It would be much cheapter to compute a numerical estimate.
Reimplemented from ErrorFunction.
Definition at line 77 of file RadiusMargin.cpp.
References KernelFunction::evalDerivative(), C_SVM::get_Cminus(), C_SVM::get_Cplus(), C_SVM::getCRatio(), SVM::getKernel(), Model::getParameterDimension(), MetaSVM::getSVM(), i, C_SVM::is2norm(), and solveProblems().
| SharkInt64 RadiusMargin::iterations | ( | ) | [inline] |
return the number of iterations last used by the quadratic program solver
Definition at line 119 of file RadiusMargin.h.
References iter.
| void RadiusMargin::setMaxIterations | ( | SharkInt64 | maxiter = -1 |
) | [inline] |
set the maximum number of iterations for the quadratic program solver
Definition at line 112 of file RadiusMargin.h.
References maxIter.
| double RadiusMargin::solveProblems | ( | SVM * | pSVM, | |
| double | Cplus, | |||
| double | Cminus, | |||
| const Array< double > & | input, | |||
| const Array< double > & | target, | |||
| Array< double > & | alpha, | |||
| Array< double > & | beta, | |||
| bool | norm2 | |||
| ) | [protected] |
Helper function calling the quadratic problem solver to obtain the coefficients
and
.
The function returns the squared radius or -1.0 to indicate that the solver did not find the optimum.
Definition at line 171 of file RadiusMargin.cpp.
References KernelFunction::eval(), SVM::getKernel(), QpSvmDecomp::isOptimal(), iter, QpSvmDecomp::iterations(), maxIter, QpSvmDecomp::setMaxIterations(), and QpSvmDecomp::Solve().
Referenced by error(), and errorDerivative().
SharkInt64 RadiusMargin::iter [protected] |
last number if C_Solver iterations
Definition at line 135 of file RadiusMargin.h.
Referenced by iterations(), and solveProblems().
SharkInt64 RadiusMargin::maxIter [protected] |
maximum number of C_Solver iterations
Definition at line 132 of file RadiusMargin.h.
Referenced by RadiusMargin(), setMaxIterations(), and solveProblems().