RadiusMargin Class Reference

Squared Radius-Margin-Quotient. More...

#include <RadiusMargin.h>

Inheritance diagram for RadiusMargin:
ErrorFunction

List of all members.

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 $\alpha$ and $\beta$.

Protected Attributes

SharkInt64 maxIter
 maximum number of C_Solver iterations
SharkInt64 iter
 last number if C_Solver iterations

Detailed Description

Squared Radius-Margin-Quotient.

Author:
T. Glasmachers
Date:
2006
The Radius-Margin-Quotient $ R^/\gamma^2 $ 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.
The Radius-Margin-Quotient depends on the kernel parameters as well as the SVM regularization parameter C. However, as the derivative of the $ \alpha $ vector w.r.t. C is hard to compute (in fact, it involves the inverse of the matrix $ K_{ij} = k(x_i, x_j) $ 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.
The underlying quadratic program solver may be configured to use a maximal number of iterations. Thus it is not guaranteed to find the global optimum with prespecified accuracy. In this case a radius margin quotient of 1e100 is returned and the derivative is set to zero.

Definition at line 85 of file RadiusMargin.h.


Constructor & Destructor Documentation

RadiusMargin::RadiusMargin (  ) 

Constructor.

Definition at line 42 of file RadiusMargin.cpp.

References maxIter.

RadiusMargin::~RadiusMargin (  ) 

Destructor.

Definition at line 47 of file RadiusMargin.cpp.


Member Function Documentation

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 $\alpha$ and $\beta$.

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().


Member Data Documentation

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().


The documentation for this class was generated from the following files: