Point Cloud Library (PCL) 1.12.0
|
SVM (Support Vector Machines) classification of a dataset. More...
#include <pcl/ml/svm_wrapper.h>
Public Member Functions | |
SVMClassify () | |
Constructor. | |
~SVMClassify () | |
Destructor. | |
void | setInputTrainingSet (std::vector< SVMData > training_set) |
It adds/store the training set with labelled data. | |
std::vector< SVMData > | getInputTrainingSet () |
Return the current training set. | |
void | resetTrainingSet () |
Reset the training set. | |
bool | loadClassifierModel (const char *filename) |
Read in a classifier model (in svmlight format). | |
void | getClassificationResult (std::vector< std::vector< double > > &out) |
Get the result of the classification. | |
void | saveClassificationResult (const char *filename) |
Save the classification result in an extern file. | |
void | setClassifierModel (SVMModel model) |
Set the classifier model. | |
bool | loadClassProblem (const char *filename) |
Read in a raw classification problem (in svmlight format). | |
bool | loadNormClassProblem (const char *filename) |
Read in a normalized classification problem (in svmlight format). | |
void | setProbabilityEstimates (bool set) |
Set whether the classification has to be done with the probability estimate. | |
bool | classificationTest () |
Start the classification on labelled input dataset. | |
bool | classification () |
Start the classification on un-labelled input dataset. | |
std::vector< double > | classification (SVMData in) |
Start the classification on a single set. | |
bool | saveClassProblem (const char *filename) |
Save the raw classification problem in a file (in svmlight format). | |
bool | saveNormClassProblem (const char *filename) |
Save the normalized classification problem in a file (in svmlight format). | |
![]() | |
SVM () | |
Constructor. | |
~SVM () | |
Destructor. | |
void | getLabel (std::vector< int > &labels) |
Return the labels order from the classifier model. | |
void | saveClassifierModel (const char *filename) |
Save the classifier model in an extern file (in svmlight format). | |
Protected Member Functions | |
void | scaleProblem (svm_problem &input, svm_scaling scaling) |
It scales the input dataset using the model information. | |
![]() | |
char * | readline (FILE *input) |
To read a line from the input file. | |
void | exitInputError (int line_num) |
Outputs an error in file reading. | |
const std::string & | getClassName () const |
Get a string representation of the name of this class. | |
void | adaptInputToLibSVM (std::vector< SVMData > training_set, svm_problem &prob) |
Convert the input format (vector of SVMData) into a readable format for libSVM. | |
void | adaptLibSVMToInput (std::vector< SVMData > &training_set, svm_problem prob) const |
Convert the libSVM format (svm_problem) into a easier output format. | |
bool | loadProblem (const char *filename, svm_problem &prob) |
Load a problem from an extern file. | |
bool | saveProblem (const char *filename, bool labelled) |
Save the raw problem in an extern file. | |
bool | saveProblemNorm (const char *filename, svm_problem prob_, bool labelled) |
Save the problem (with normalized values) in an extern file. | |
Protected Attributes | |
bool | model_extern_copied_ |
bool | predict_probability_ |
std::vector< std::vector< double > > | prediction_ |
std::string | class_name_ |
bool | labelled_training_set_ |
char * | line_ |
int | max_line_len_ |
SVMModel | model_ |
SVMParam | param_ |
svm_problem | prob_ |
svm_scaling | scaling_ |
std::vector< SVMData > | training_set_ |
![]() | |
std::vector< SVMData > | training_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_ |
Additional Inherited Members | |
![]() | |
static void | printNull (const char *) |
Set for output printings during classification. | |
SVM (Support Vector Machines) classification of a dataset.
It can be used both for testing a classifier model and for classify of new data.
Definition at line 376 of file svm_wrapper.h.
|
inline |
|
inline |
Destructor.
Definition at line 404 of file svm_wrapper.h.
References svm_model::l, model_, and model_extern_copied_.
bool pcl::SVMClassify::classification | ( | ) |
Start the classification on un-labelled input dataset.
To get the classification result, use getClassificationResult().
Start the classification on a single set.
bool pcl::SVMClassify::classificationTest | ( | ) |
Start the classification on labelled input dataset.
It returns the accuracy percentage. To get the classification result, use getClassificationResult().
Get the result of the classification.
Definition at line 450 of file svm_wrapper.h.
References prediction_.
|
inline |
Return the current training set.
Definition at line 429 of file svm_wrapper.h.
References training_set_.
Read in a classifier model (in svmlight format).
Read in a raw classification problem (in svmlight format).
The values are normalized using the classifier model information.
Definition at line 490 of file svm_wrapper.h.
References pcl::SVM::adaptLibSVMToInput(), svm_model::l, pcl::SVM::loadProblem(), model_, prob_, scaleProblem(), scaling_, and training_set_.
Read in a normalized classification problem (in svmlight format).
The data are kept whitout normalizing.
Definition at line 507 of file svm_wrapper.h.
References pcl::SVM::adaptLibSVMToInput(), pcl::SVM::loadProblem(), prob_, and training_set_.
|
inline |
Save the classification result in an extern file.
Save the raw classification problem in a file (in svmlight format).
Definition at line 550 of file svm_wrapper.h.
References pcl::SVM::saveProblem().
Save the normalized classification problem in a file (in svmlight format).
Definition at line 560 of file svm_wrapper.h.
References prob_, and pcl::SVM::saveProblemNorm().
|
protected |
It scales the input dataset using the model information.
Referenced by loadClassProblem().
Set the classifier model.
Definition at line 462 of file svm_wrapper.h.
References svm_node::index, svm_scaling::max, model_, model_extern_copied_, svm_scaling::obj, svm_model::scaling, and scaling_.
It adds/store the training set with labelled data.
Definition at line 412 of file svm_wrapper.h.
References pcl::SVM::adaptInputToLibSVM(), pcl::SVM::getClassName(), svm_scaling::max, prob_, scaling_, pcl::ConstCloudIterator< PointT >::size(), and training_set_.
Set whether the classification has to be done with the probability estimate.
(The classifier model has to support it).
Definition at line 517 of file svm_wrapper.h.
References predict_probability_.
|
protected |
Definition at line 129 of file svm_wrapper.h.
Referenced by SVMClassify().
|
protected |
Definition at line 133 of file svm_wrapper.h.
|
protected |
Definition at line 131 of file svm_wrapper.h.
|
protected |
Definition at line 132 of file svm_wrapper.h.
|
protected |
Definition at line 125 of file svm_wrapper.h.
Referenced by loadClassProblem(), setClassifierModel(), and ~SVMClassify().
|
protected |
Definition at line 388 of file svm_wrapper.h.
Referenced by setClassifierModel(), and ~SVMClassify().
|
protected |
Definition at line 128 of file svm_wrapper.h.
|
protected |
Definition at line 389 of file svm_wrapper.h.
Referenced by setProbabilityEstimates().
|
protected |
Definition at line 390 of file svm_wrapper.h.
Referenced by getClassificationResult().
|
protected |
Definition at line 124 of file svm_wrapper.h.
Referenced by loadClassProblem(), loadNormClassProblem(), saveNormClassProblem(), and setInputTrainingSet().
|
protected |
Definition at line 126 of file svm_wrapper.h.
Referenced by loadClassProblem(), setClassifierModel(), and setInputTrainingSet().
|
protected |
Definition at line 123 of file svm_wrapper.h.
Referenced by getInputTrainingSet(), loadClassProblem(), loadNormClassProblem(), resetTrainingSet(), and setInputTrainingSet().