88 #ifndef TWOCLASSSVMC_HH 89 #define TWOCLASSSVMC_HH 131 template<
typename KF>
135 template<
typename FV>
150 _cost( COST_DEFAULT),
151 _positiveClassWeight( POSITIVE_CLASS_WEIGHT_DEFAULT)
165 _cost( COST_DEFAULT),
166 _positiveClassWeight( POSITIVE_CLASS_WEIGHT_DEFAULT)
191 template<
typename FV>
213 template<
typename ForwardIter>
214 void train( ForwardIter FV_begin,
const ForwardIter& FV_end,
215 svt::Model<
typename std::iterator_traits<ForwardIter>::value_type>& model)
const 244 template<
typename ForwardIter,
typename Accessor>
245 void train( ForwardIter FV_begin,
const ForwardIter& FV_end,
247 Accessor accessor)
const;
281 _positiveClassWeight = weight;
286 return _positiveClassWeight;
295 template<
typename STDATA>
301 stData.getValue(
"cost", _cost);
302 stData.getValue(
"weight", _positiveClassWeight);
305 template<
typename STDATA>
311 stData.setValue(
"two_class_type",
name());
312 stData.setValue(
"cost", _cost);
313 stData.setValue(
"weight", _positiveClassWeight);
323 return "Two class SVM using C-SVC algorithm for training";
340 "penalty cost for wrong training vectors " 341 "in C-SVC. (default 1)"));
344 "weight for positive class samples in " 345 "two-class C-SVC. (default 1)"));
352 template<
typename FV>
360 double _positiveClassWeight;
367 #include "TwoClassSVMc.icc"
static const double POSITIVE_CLASS_WEIGHT_DEFAULT
static void getParamInfos(std::vector< ParamInfo > &p)
get information about the parameters, that are used in loadParameters() and saveParameters().
static void getParamInfos(std::vector< ParamInfo > &p)
get information about the parameters, that are used in loadParameters() and saveParameters().
#define CHECK_MEMBER_TEMPLATE(c)
void setCost(double c)
set the parameter C for C-SVM (cost for outliers).
void train(ForwardIter FV_begin, const ForwardIter &FV_end, svt::Model< typename std::iterator_traits< ForwardIter >::value_type > &model) const
train (STL-like interface) Your feature vector class must provide a method double getLabel()...
double weightOfPositiveClass() const
void loadParameters(STDATA &stData)
Load and save parameters cost and weight from map.
void setWeightOfPositiveClass(double weight)
set the parameter C of positive class (labeled with +1) to weight*C.
TwoClassSVMc(const KF &kernel)
(description)
static const double COST_DEFAULT
void loadParameters(STDATA &stData)
Load parameters from structured data object.
static const char * name()
The TwoClassSVMc class (is/provides/specifies/contains)
~TwoClassSVMc()
(description)
void saveParameters(STDATA &stData) const
save parameters to structured data object
The TwoClassSVM class is the basic class for TwoClassSVMc and TwoClassSVMnu and maybe some more later...
TwoClassSVMc()
(description)
void saveParameters(STDATA &stData) const
void train(const SVM_Problem< FV > &problem, Model< FV > &model) const
train SVM with given Feature Vectors.
static const char * description()
void solve_c_svc(const SVM_Problem< FV > *prob, double *alpha, SolutionInfo *si, Model< FV > &model) const
The ParamInfo class contains informations about one parameter like key, help text, guiHints etc.
KF & kernel()
access the kernel function