Point Cloud Library (PCL)  1.9.1-dev
List of all members | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
pcl::SVM Class Reference

Base class for SVM SVM (Support Vector Machines). More...

#include <pcl/ml/svm_wrapper.h>

+ Inheritance diagram for pcl::SVM:

Public Member Functions

 SVM ()
 Constructor. More...
 
 ~SVM ()
 Destructor. More...
 
void getLabel (std::vector< int > &labels)
 Return the labels order from the classifier model. More...
 
void saveClassifierModel (const char *filename)
 Save the classifier model in an extern file (in svmlight format). More...
 

Protected Member Functions

char * readline (FILE *input)
 To read a line from the input file. More...
 
void exitInputError (int line_num)
 Outputs an error in file reading. More...
 
const std::string & getClassName () const
 Get a string representation of the name of this class. More...
 
void adaptInputToLibSVM (std::vector< SVMData > training_set, svm_problem &prob)
 Convert the input format (vector of SVMData) into a readable format for libSVM. More...
 
void adaptLibSVMToInput (std::vector< SVMData > &training_set, svm_problem prob)
 Convert the libSVM format (svm_problem) into a easier output format. More...
 
bool loadProblem (const char *filename, svm_problem &prob)
 Load a problem from an extern file. More...
 
bool saveProblem (const char *filename, bool labelled)
 Save the raw problem in an extern file. More...
 
bool saveProblemNorm (const char *filename, svm_problem prob_, bool labelled)
 Save the problem (with normalized values) in an extern file. More...
 

Static Protected Member Functions

static void printNull (const char *)
 Set for output printings during classification. More...
 

Protected Attributes

std::vector< SVMDatatraining_set_
 
svm_problem prob_
 
SVMModel model_
 
svm_scaling scaling_
 
SVMParam param_
 
std::string class_name_
 
char * line_
 
int max_line_len_
 
bool labelled_training_set_
 

Detailed Description

Base class for SVM SVM (Support Vector Machines).

Definition at line 126 of file svm_wrapper.h.

Constructor & Destructor Documentation

pcl::SVM::SVM ( )
inline

Constructor.

Definition at line 178 of file svm_wrapper.h.

pcl::SVM::~SVM ( )
inline

Destructor.

Definition at line 184 of file svm_wrapper.h.

References svm_problem::l, svm_scaling::max, svm_scaling::obj, svm_problem::x, and svm_problem::y.

Member Function Documentation

void pcl::SVM::adaptInputToLibSVM ( std::vector< SVMData training_set,
svm_problem prob 
)
protected

Convert the input format (vector of SVMData) into a readable format for libSVM.

Referenced by pcl::SVMClassify::setInputTrainingSet().

void pcl::SVM::adaptLibSVMToInput ( std::vector< SVMData > &  training_set,
svm_problem  prob 
)
protected

Convert the libSVM format (svm_problem) into a easier output format.

Referenced by pcl::SVMClassify::loadClassProblem(), and pcl::SVMClassify::loadNormClassProblem().

void pcl::SVM::exitInputError ( int  line_num)
inlineprotected

Outputs an error in file reading.

Definition at line 148 of file svm_wrapper.h.

const std::string& pcl::SVM::getClassName ( ) const
inlineprotected

Get a string representation of the name of this class.

Definition at line 156 of file svm_wrapper.h.

void pcl::SVM::getLabel ( std::vector< int > &  labels)
inline

Return the labels order from the classifier model.

Definition at line 201 of file svm_wrapper.h.

bool pcl::SVM::loadProblem ( const char *  filename,
svm_problem prob 
)
protected
static void pcl::SVM::printNull ( const char *  )
inlinestaticprotected

Set for output printings during classification.

Definition at line 141 of file svm_wrapper.h.

char* pcl::SVM::readline ( FILE *  input)
protected

To read a line from the input file.

Stored in "line_".

void pcl::SVM::saveClassifierModel ( const char *  filename)
inline

Save the classifier model in an extern file (in svmlight format).

Definition at line 214 of file svm_wrapper.h.

References svm_model::l.

bool pcl::SVM::saveProblem ( const char *  filename,
bool  labelled 
)
protected

Save the raw problem in an extern file.

Referenced by pcl::SVMClassify::saveClassProblem(), and pcl::SVMTrain::saveTrainingSet().

bool pcl::SVM::saveProblemNorm ( const char *  filename,
svm_problem  prob_,
bool  labelled 
)
protected

Save the problem (with normalized values) in an extern file.

Referenced by pcl::SVMClassify::saveNormClassProblem(), and pcl::SVMTrain::saveNormTrainingSet().

Member Data Documentation

std::string pcl::SVM::class_name_
protected

Definition at line 134 of file svm_wrapper.h.

bool pcl::SVM::labelled_training_set_
protected

Definition at line 138 of file svm_wrapper.h.

char* pcl::SVM::line_
protected

Definition at line 136 of file svm_wrapper.h.

int pcl::SVM::max_line_len_
protected

Definition at line 137 of file svm_wrapper.h.

SVMModel pcl::SVM::model_
protected

Definition at line 131 of file svm_wrapper.h.

SVMParam pcl::SVM::param_
protected

Definition at line 133 of file svm_wrapper.h.

svm_problem pcl::SVM::prob_
protected

Definition at line 130 of file svm_wrapper.h.

svm_scaling pcl::SVM::scaling_
protected

Definition at line 132 of file svm_wrapper.h.

std::vector<SVMData> pcl::SVM::training_set_
protected

Definition at line 129 of file svm_wrapper.h.


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