114 #ifndef MULTICLASSSVMONEVSONE_HH 115 #define MULTICLASSSVMONEVSONE_HH 168 template<
typename SVM>
178 template<
typename FV>
250 _twoClassSVM.setProgressReporter( pr);
287 template<
typename ForwardIter,
typename Accessor>
289 const ForwardIter& fvEnd,
290 Accessor accessor)
const 292 _twoClassSVM.updateKernelCache( fvBegin, fvEnd, accessor);
309 _twoClassSVM.clearKernelCache();
334 template<
typename FV>
351 template<
typename FV>
356 train( trainData, model);
382 template<
typename ForwardIter>
384 const ForwardIter& FV_end,
385 typename Traits<
typename std::iterator_traits< ForwardIter>::value_type>::
ModelType& model)
const 414 template<
typename ForwardIter,
typename Accessor>
416 const ForwardIter& FV_end,
418 Accessor accessor)
const 423 train( trainData, model);
450 template<
typename FV>
454 const std::vector<char>& leaveOutFlagsByUID,
472 template<
typename FV,
typename ResultMatrix>
474 const FV& testObject,
476 ResultMatrix& resultMatrix)
const;
489 template<
typename FV>
491 const FV& testObject,
514 template<
typename FV,
typename ResultMatrix>
517 ResultMatrix& resultMatrix)
const 534 template<
typename FV>
539 return classify( testObject, model, dummy);
543 template<
typename STDATA>
548 _twoClassSVM.loadParameters(stData);
552 template<
typename STDATA>
557 stData.setValue(
"multi_class_type",
name());
558 _twoClassSVM.saveParameters( stData);
571 template<
typename ModelType,
typename STDATA>
573 const DetailedResultType&,
576 std::cerr <<
"warning: saving details from " 577 "MultiClassSVMOneVsOne not implemented yet!\n";
602 return "multi-class SVM by using the 'one versus one' approach";
612 #include "MultiClassSVMOneVsOne.icc"
The GroupedTrainingData class is a container for feature vectors.
#define CHECK_MEMBER_TEMPLATE(c)
void updateKernelCache(const ForwardIter &fvBegin, const ForwardIter &fvEnd, Accessor accessor) const
call the updateKernelCache() method of selected two-class svm
void saveParameters(STDATA &stData) const
double classify(const FV &testObject, const typename Traits< FV >::ModelType &model, ResultMatrix &resultMatrix) const
classify the given testObject using the models in Model matrix.
static const char * name()
double classIndexToLabel(unsigned int classIndex) const
#define CHECK_CLASS_TEMPLATE1(c)
double & operator()(int, int)
The TriangularMatrix class is an upper triangular matrix without diagonal elements.
double classify(const FV &testObject, const typename Traits< FV >::ModelType &model) const
classify the given testObject using the model
void train(ForwardIter FV_begin, const ForwardIter &FV_end, typename Traits< typename std::iterator_traits< ForwardIter >::value_type >::ModelType &model) const
train the Multi Class SVM with the given feature vectors.
The MultiClassSVMOneVsOne class provides a one vs.
void clearKernelCache() const
call the clearKernelCache() method of selected two-class svm
const SVM & twoClassSVM() const
static void getParamInfos(std::vector< ParamInfo > &)
get information about the parameters, that are used in loadParameters() and saveParameters().
#define CHECK_CLASS_TEMPLATE2(c)
void loadParameters(STDATA &stData)
Ensure that TESTCLASS provides a loadParameters() and saveParamters() method.
MultiClassSVMOneVsOne(const SVM &svm)
Create a multi class SVM basing on the given svm object.
MultiClassSVMOneVsOne()
Create a multi class SVM.
TriangularMatrix< double > DetailedResultType
unsigned int predictClassIndex(const FV &testObject, const typename Traits< FV >::ModelType &model) const
classify the given testObject using the model
void setProgressReporter(ProgressReporter *pr)
set a progress reporter object.
void saveClassificationDetails(const ModelType &, const DetailedResultType &, STDATA &) const
save classification details.
void resizeWidth(unsigned int)
void train(const SVM_Problem< FV > &problem, typename Traits< FV >::ModelType &model) const
train SVM with given Feature Vectors.
void train(const GroupedTrainingData< FV > &trainData, typename Traits< FV >::ModelType &model) const
train SVM with given Feature Vectors.
void retrainWithLeftOutVectors(const GroupedTrainingData< FV > &trainData, const typename Traits< FV >::ModelType &fullModel, const std::vector< char > &leaveOutFlagsByUID, typename Traits< FV >::ModelType &resultingModel) const
calls the retrainWithLeftOutVectors() for each two-class model, only if the model is affected by the ...
void train(ForwardIter FV_begin, const ForwardIter &FV_end, typename Traits< typename Accessor::template Traits< ForwardIter >::value_type >::ModelType &model, Accessor accessor) const
same as train(), but you can specify an Accessor for accessing the elements of your container...
Model_MC_OneVsOne< typename SVM::template Traits< FV >::ModelType > ModelType
Ensure that TESTCLASS provides a setProgressReporter() method.
static const char * description()
unsigned int predictClassIndex(const FV &testObject, const typename Traits< FV >::ModelType &model, ResultMatrix &resultMatrix) const
classify the given testObject using the model