shark::CSVMProblem< MatrixT > Class Template Reference

Problem formulation for binary C-SVM problems. More...

#include <shark/Algorithms/QP/QpSolver.h>

Public Types

typedef MatrixT MatrixType
 
typedef MatrixType::QpFloatType QpFloatType
 

Public Member Functions

 CSVMProblem (MatrixType &quadratic, Data< unsigned int > const &labels, double C)
 Setup only using kernel matrix, labels and regularization parameter. More...
 
 CSVMProblem (MatrixType &quadratic, Data< unsigned int > const &labels, RealVector const &regularizers)
 Setup using kernel matrix, labels and different regularization parameters for positive and negative classes. More...
 
 CSVMProblem (MatrixType &quadratic, RealVector linear, Data< unsigned int > const &labels, double C)
 
std::size_t dimensions () const
 
double boxMin (std::size_t i) const
 
double boxMax (std::size_t i) const
 
void flipCoordinates (std::size_t i, std::size_t j)
 exchange two variables via the permutation More...
 
void scaleBoxConstraints (double factor, double variableScalingFactor)
 Scales all box constraints by a constant factor and adapts the solution by scaling it by the same factor. More...
 

Public Attributes

MatrixTypequadratic
 representation of the quadratic part of the objective function More...
 
RealVector linear
 Linear part of the problem. More...
 
RealVector alpha
 Solution candidate. More...
 
RealVector diagonal
 
std::vector< std::size_t > permutation
 permutation of the variables alpha, gradient, etc. More...
 

Detailed Description

template<class MatrixT>
class shark::CSVMProblem< MatrixT >

Problem formulation for binary C-SVM problems.

max_ - 1/2 ^T K + ^Ty under constraints: l_i <= <= u_i = 0

Definition at line 246 of file QpSolver.h.

Member Typedef Documentation

◆ MatrixType

template<class MatrixT>
typedef MatrixT shark::CSVMProblem< MatrixT >::MatrixType

Definition at line 248 of file QpSolver.h.

◆ QpFloatType

template<class MatrixT>
typedef MatrixType::QpFloatType shark::CSVMProblem< MatrixT >::QpFloatType

Definition at line 249 of file QpSolver.h.

Constructor & Destructor Documentation

◆ CSVMProblem() [1/3]

template<class MatrixT>
shark::CSVMProblem< MatrixT >::CSVMProblem ( MatrixType quadratic,
Data< unsigned int > const &  labels,
double  C 
)
inline

◆ CSVMProblem() [2/3]

template<class MatrixT>
shark::CSVMProblem< MatrixT >::CSVMProblem ( MatrixType quadratic,
Data< unsigned int > const &  labels,
RealVector const &  regularizers 
)
inline

◆ CSVMProblem() [3/3]

Member Function Documentation

◆ boxMax()

template<class MatrixT>
double shark::CSVMProblem< MatrixT >::boxMax ( std::size_t  i) const
inline

Definition at line 330 of file QpSolver.h.

◆ boxMin()

template<class MatrixT>
double shark::CSVMProblem< MatrixT >::boxMin ( std::size_t  i) const
inline

Definition at line 327 of file QpSolver.h.

◆ dimensions()

template<class MatrixT>
std::size_t shark::CSVMProblem< MatrixT >::dimensions ( ) const
inline

Definition at line 323 of file QpSolver.h.

References shark::GeneralQuadraticProblem< MatrixT >::quadratic.

◆ flipCoordinates()

template<class MatrixT>
void shark::CSVMProblem< MatrixT >::flipCoordinates ( std::size_t  i,
std::size_t  j 
)
inline

exchange two variables via the permutation

Definition at line 351 of file QpSolver.h.

References shark::swap().

◆ scaleBoxConstraints()

template<class MatrixT>
void shark::CSVMProblem< MatrixT >::scaleBoxConstraints ( double  factor,
double  variableScalingFactor 
)
inline

Scales all box constraints by a constant factor and adapts the solution by scaling it by the same factor.

Definition at line 365 of file QpSolver.h.

References shark::GeneralQuadraticProblem< MatrixT >::alpha, and shark::GeneralQuadraticProblem< MatrixT >::dimensions().

Member Data Documentation

◆ alpha

template<class MatrixT>
RealVector shark::CSVMProblem< MatrixT >::alpha

Solution candidate.

Definition at line 341 of file QpSolver.h.

◆ diagonal

template<class MatrixT>
RealVector shark::CSVMProblem< MatrixT >::diagonal

diagonal matrix entries The diagonal array is of fixed size and not subject to shrinking.

Definition at line 345 of file QpSolver.h.

◆ linear

template<class MatrixT>
RealVector shark::CSVMProblem< MatrixT >::linear

Linear part of the problem.

Definition at line 338 of file QpSolver.h.

◆ permutation

template<class MatrixT>
std::vector<std::size_t> shark::CSVMProblem< MatrixT >::permutation

permutation of the variables alpha, gradient, etc.

Definition at line 348 of file QpSolver.h.

◆ quadratic

template<class MatrixT>
MatrixType& shark::CSVMProblem< MatrixT >::quadratic

representation of the quadratic part of the objective function

Definition at line 335 of file QpSolver.h.


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