Loading...
Searching...
No Matches
svm_wrapper.h
/*
* Software License Agreement (BSD License)
*
* Point Cloud Library (PCL) - www.pointclouds.org
* Copyright (c) 2010-2012, Willow Garage, Inc.
* Copyright (c) 2000-2012 Chih-Chung Chang and Chih-Jen Lin
*
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above
* copyright notice, this list of conditions and the following
* disclaimer in the documentation and/or other materials provided
* with the distribution.
* * Neither the name of copyright holders nor the names of its
* contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*
*/
#pragma once
#include <pcl/console/print.h> // for PCL_ERROR
#include <pcl/ml/svm.h>
#include <cassert> // for assert
#include <cstdio>
#include <cstdlib>
#include <limits> // for numeric_limits
#include <string> // for string
#include <vector>
// NOLINTNEXTLINE(bugprone-macro-parentheses)
#define Malloc(type, n) static_cast<type*>(malloc((n) * sizeof(type)))
namespace pcl {
/** The structure stores the parameters for the classificationa nd must be initialized
* and passed to the training method pcl::SVMTrain.
*
* \param svm_type {C_SVC, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR}
* \param kernel_type {LINEAR, POLY, RBF, SIGMOID, PRECOMPUTED}
* \param probability sets the probability estimates
*/
struct SVMParam : svm_parameter {
SVMParam()
{
svm_type = C_SVC; // C_SVC, NU_SVC, ONE_CLASS, EPSILON_SVR, NU_SVR
kernel_type = RBF; // LINEAR, POLY, RBF, SIGMOID, PRECOMPUTED
degree = 3; // for poly
gamma = 0; // 1/num_features {for poly/rbf/sigmoid}
coef0 = 0; // for poly/sigmoid
nu = 0.5; // for NU_SVC, ONE_CLASS, and NU_SVR
cache_size = 100; // in MB
C = 1; // for C_SVC, EPSILON_SVR and NU_SVR
eps = 1e-3; // stopping criteria
p = 0.1; // for EPSILON_SVR
shrinking = 0; // use the shrinking heuristics
probability = 0; // do probability estimates
nr_weight = 0; // for C_SVC
weight_label = nullptr; // for C_SVC
weight = nullptr; // for C_SVC
}
};
/** The structure initialize a model created by the SVM (Support Vector Machines)
* classifier (pcl::SVMTrain).
*/
struct SVMModel : svm_model {
SVMModel()
{
l = 0;
probA = nullptr;
probB = nullptr;
}
};
/** The structure initialize a single feature value for the classification using
* SVM (Support Vector Machines).
*/
struct SVMDataPoint {
/// It's the feature index. It has to be an integer number greater or equal to zero
int idx{-1};
/// The value assigned to the correspondent feature.
float value{0.0f};
SVMDataPoint() = default;
};
/** The structure stores the features and the label of a single sample which has to be
* used for the training or the classification of the SVM (Support Vector Machines).
*/
struct SVMData {
/// Pointer to the label value. It is a mandatory to train the classifier
double label;
/// Vector of features for the specific sample.
std::vector<pcl::SVMDataPoint> SV;
SVMData() : label(std::numeric_limits<double>::signaling_NaN()) {}
};
/** Base class for SVM SVM (Support Vector Machines). */
class SVM {
protected:
std::vector<SVMData> training_set_; // Basic training set
svm_problem prob_; // contains the problem (vector of samples with their features)
SVMModel model_; // model of the classifier
svm_scaling scaling_; // for the best model training, the input dataset is scaled and
// the scaling factors are stored here
SVMParam param_; // it stores the training parameters
std::string class_name_; // The SVM class name.
char* line_{nullptr}; // buffer for line reading
int max_line_len_{10000}; // max line length in the input file
bool labelled_training_set_{
true}; // it stores whether the input set of samples is labelled
/** Set for output printings during classification. */
static void
printNull(const char*){};
/** To read a line from the input file. Stored in "line_". */
char*
readline(FILE* input);
/** Outputs an error in file reading. */
void
exitInputError(int line_num)
{
fprintf(stderr, "Wrong input format at line %d\n", line_num);
exit(1);
}
/** Get a string representation of the name of this class. */
inline const std::string&
getClassName() const
{
return (class_name_);
}
/** Convert the input format (vector of SVMData) into a readable format for libSVM. */
void
adaptInputToLibSVM(std::vector<SVMData> training_set, svm_problem& prob);
/** Convert the libSVM format (svm_problem) into a easier output format. */
void
adaptLibSVMToInput(std::vector<SVMData>& training_set, svm_problem prob) const;
/** Load a problem from an extern file. */
bool
loadProblem(const char* filename, svm_problem& prob);
/** Save the raw problem in an extern file.*/
bool
saveProblem(const char* filename, bool labelled);
/** Save the problem (with normalized values) in an extern file.*/
bool
saveProblemNorm(const char* filename, svm_problem prob_, bool labelled);
public:
/** Constructor. */
SVM() : prob_() {}
/** Destructor. */
~SVM()
{
svm_destroy_param(&param_); // delete parameters
if (scaling_.max > 0)
free(scaling_.obj); // delete scaling factors
// delete the problem
if (prob_.l > 0) {
free(prob_.x);
free(prob_.y);
}
}
/** Return the labels order from the classifier model. */
void
getLabel(std::vector<int>& labels)
{
int nr_class = svm_get_nr_class(&model_);
int* labels_ = static_cast<int*>(malloc(nr_class * sizeof(int)));
svm_get_labels(&model_, labels_);
for (int j = 0; j < nr_class; j++)
labels.push_back(labels_[j]);
free(labels_);
};
/** Save the classifier model in an extern file (in svmlight format). */
void
saveClassifierModel(const char* filename)
{
// exit if model has no data
if (model_.l == 0)
return;
if (svm_save_model(filename, &model_)) {
fprintf(stderr, "can't save model to file %s\n", filename);
exit(1);
}
};
};
/** SVM (Support Vector Machines) training class for the SVM machine learning.
*
* It creates a model for the classifier from a labelled input dataset.
*
* OPTIONAL: pcl::SVMParam has to be given as input to vary the default training method
* and parameters.
*/
class SVMTrain : public SVM {
protected:
using SVM::class_name_;
using SVM::labelled_training_set_;
using SVM::line_;
using SVM::max_line_len_;
using SVM::model_;
using SVM::param_;
using SVM::prob_;
using SVM::scaling_;
using SVM::training_set_;
/// Set to 1 to see the training output
bool debug_{false};
/// Set too 1 for cross validating the classifier
int cross_validation_{0};
/// Number of folds to be used during cross validation. It indicates in how many parts
/// is split the input training set.
int nr_fold_{0};
/** To cross validate the classifier. It is automatic for probability estimate. */
void
doCrossValidation();
/** It extracts scaling factors from the input training_set.
*
* The scaling of the training_set is a mandatory for a good training of the
* classifier. */
void
scaleFactors(std::vector<SVMData> training_set, svm_scaling& scaling);
public:
/** Constructor. */
SVMTrain()
{
class_name_ = "SVMTrain";
svm_set_print_string_function(
&printNull); // Default to NULL to not print debugging info
}
/** Destructor. */
~SVMTrain()
{
if (model_.l > 0)
svm_free_model_content(&model_);
}
/** Change default training parameters (pcl::SVMParam). */
void
setParameters(SVMParam param)
{
param_ = param;
}
/** Return the current training parameters. */
SVMParam
getParameters()
{
return param_;
}
/** Return the result of the training. */
SVMModel
getClassifierModel()
{
return model_;
}
/** It adds/store the training set with labelled data. */
void
setInputTrainingSet(std::vector<SVMData> training_set)
{
training_set_.insert(training_set_.end(), training_set.begin(), training_set.end());
}
/** Return the current training set. */
std::vector<SVMData>
getInputTrainingSet()
{
return training_set_;
}
/** Reset the training set. */
void
resetTrainingSet()
{
training_set_.clear();
}
/** Start the training of the SVM classifier.
*
* \return false if fails
*/
bool
trainClassifier();
/** Read in a problem (in svmlight format).
*
* \return false if fails
*/
bool
loadProblem(const char* filename)
{
return SVM::loadProblem(filename, prob_);
};
/** Set to 1 for debugging info. */
void
setDebugMode(bool in)
{
debug_ = in;
if (in)
svm_set_print_string_function(nullptr);
else
svm_set_print_string_function(&printNull);
};
/** Save the raw training set in a file (in svmlight format).
*
* \return false if fails
*/
bool
saveTrainingSet(const char* filename)
{
return SVM::saveProblem(filename, true);
};
/** Save the normalized training set in a file (in svmlight format).
*
* \return false if fails
*/
bool
saveNormTrainingSet(const char* filename)
{
return SVM::saveProblemNorm(filename, prob_, true);
};
};
/** SVM (Support Vector Machines) classification of a dataset.
*
* It can be used both for testing a classifier model and for classify of new data.
*/
class SVMClassify : public SVM {
protected:
using SVM::class_name_;
using SVM::labelled_training_set_;
using SVM::line_;
using SVM::max_line_len_;
using SVM::model_;
using SVM::param_;
using SVM::prob_;
using SVM::scaling_;
using SVM::training_set_;
bool model_extern_copied_{
false}; // Set to 0 if the model is loaded from an extern file.
bool predict_probability_{false}; // Set to 1 to predict probabilities.
std::vector<std::vector<double>> prediction_; // It stores the resulting prediction.
/** It scales the input dataset using the model information. */
void
scaleProblem(svm_problem& input, svm_scaling scaling);
public:
/** Constructor. */
SVMClassify() { class_name_ = "SvmClassify"; }
/** Destructor. */
~SVMClassify()
{
if (!model_extern_copied_ && model_.l > 0)
svm_free_model_content(&model_);
}
/** It adds/store the training set with labelled data. */
void
setInputTrainingSet(std::vector<SVMData> training_set)
{
assert(training_set.size() > 0);
if (scaling_.max == 0) {
// to be sure to have loaded the scaling
PCL_ERROR("[pcl::%s::setInputTrainingSet] Classifier model not loaded!\n",
getClassName().c_str());
return;
}
training_set_.insert(training_set_.end(), training_set.begin(), training_set.end());
SVM::adaptInputToLibSVM(training_set_, prob_);
}
/** Return the current training set. */
std::vector<SVMData>
getInputTrainingSet()
{
return training_set_;
}
/** Reset the training set. */
void
resetTrainingSet()
{
training_set_.clear();
}
/** Read in a classifier model (in svmlight format).
*
* \return false if fails
*/
bool
loadClassifierModel(const char* filename);
/** Get the result of the classification. */
void
getClassificationResult(std::vector<std::vector<double>>& out)
{
out.clear();
out.insert(out.begin(), prediction_.begin(), prediction_.end());
}
/** Save the classification result in an extern file. */
void
saveClassificationResult(const char* filename);
/** Set the classifier model. */
void
setClassifierModel(SVMModel model)
{
// model (inner pointers are references)
model_ = model;
int i = 0;
while (model_.scaling[i].index != -1)
i++;
scaling_.max = i;
scaling_.obj = Malloc(struct svm_node, i + 1);
scaling_.obj[i].index = -1;
// Performing full scaling copy
for (int j = 0; j < i; j++) {
scaling_.obj[j] = model_.scaling[j];
}
model_extern_copied_ = true;
};
/** Read in a raw classification problem (in svmlight format).
*
* The values are normalized using the classifier model information.
*
* \return false if fails
*/
bool
loadClassProblem(const char* filename)
{
assert(model_.l != 0);
bool out = SVM::loadProblem(filename, prob_);
SVM::adaptLibSVMToInput(training_set_, prob_);
scaleProblem(prob_, scaling_);
return out;
};
/** Read in a normalized classification problem (in svmlight format).
*
* The data is kept without normalizing.
*
* \return false if fails
*/
bool
loadNormClassProblem(const char* filename)
{
bool out = SVM::loadProblem(filename, prob_);
SVM::adaptLibSVMToInput(training_set_, prob_);
return out;
};
/** Set whether the classification has to be done with the probability estimate. (The
* classifier model has to support it). */
void
setProbabilityEstimates(bool set)
{
predict_probability_ = set;
};
/** Start the classification on labelled input dataset.
*
* It returns the accuracy percentage. To get the classification result, use
* getClassificationResult().
*
* \return false if fails
*/
bool
classificationTest();
/** Start the classification on un-labelled input dataset.
*
* To get the classification result, use getClassificationResult().
*
* \return false if fails
*/
bool
classification();
/** Start the classification on a single set. */
std::vector<double>
classification(SVMData in);
/** Save the raw classification problem in a file (in svmlight format).
*
* \return false if fails
*/
bool
saveClassProblem(const char* filename)
{
return SVM::saveProblem(filename, false);
};
/** Save the normalized classification problem in a file (in svmlight format).
*
* \return false if fails
*/
bool
saveNormClassProblem(const char* filename)
{
return SVM::saveProblemNorm(filename, prob_, false);
};
};
} // namespace pcl
pcl::SVMClassify
SVM (Support Vector Machines) classification of a dataset.
Definition svm_wrapper.h:378
pcl::SVMClassify::saveClassProblem
bool saveClassProblem(const char *filename)
Save the raw classification problem in a file (in svmlight format).
Definition svm_wrapper.h:550
pcl::SVMClassify::saveNormClassProblem
bool saveNormClassProblem(const char *filename)
Save the normalized classification problem in a file (in svmlight format).
Definition svm_wrapper.h:560
pcl::SVMClassify::model_
SVMModel model_
Definition svm_wrapper.h:126
pcl::SVMClassify::prediction_
std::vector< std::vector< double > > prediction_
Definition svm_wrapper.h:393
pcl::SVMClassify::loadClassProblem
bool loadClassProblem(const char *filename)
Read in a raw classification problem (in svmlight format).
Definition svm_wrapper.h:490
pcl::SVMClassify::resetTrainingSet
void resetTrainingSet()
Reset the training set.
Definition svm_wrapper.h:436
pcl::SVMClassify::predict_probability_
bool predict_probability_
Definition svm_wrapper.h:392
pcl::SVMClassify::~SVMClassify
~SVMClassify()
Destructor.
Definition svm_wrapper.h:404
pcl::SVMClassify::classification
bool classification()
Start the classification on un-labelled input dataset.
pcl::SVMClassify::saveClassificationResult
void saveClassificationResult(const char *filename)
Save the classification result in an extern file.
pcl::SVMClassify::setProbabilityEstimates
void setProbabilityEstimates(bool set)
Set whether the classification has to be done with the probability estimate.
Definition svm_wrapper.h:517
pcl::SVMClassify::getInputTrainingSet
std::vector< SVMData > getInputTrainingSet()
Return the current training set.
Definition svm_wrapper.h:429
pcl::SVMClassify::SVMClassify
SVMClassify()
Constructor.
Definition svm_wrapper.h:401
pcl::SVMClassify::classification
std::vector< double > classification(SVMData in)
Start the classification on a single set.
pcl::SVMClassify::model_extern_copied_
bool model_extern_copied_
Definition svm_wrapper.h:390
pcl::SVMClassify::classificationTest
bool classificationTest()
Start the classification on labelled input dataset.
pcl::SVMClassify::setClassifierModel
void setClassifierModel(SVMModel model)
Set the classifier model.
Definition svm_wrapper.h:462
pcl::SVMClassify::setInputTrainingSet
void setInputTrainingSet(std::vector< SVMData > training_set)
It adds/store the training set with labelled data.
Definition svm_wrapper.h:412
pcl::SVMClassify::loadClassifierModel
bool loadClassifierModel(const char *filename)
Read in a classifier model (in svmlight format).
pcl::SVMClassify::class_name_
std::string class_name_
Definition svm_wrapper.h:130
pcl::SVMClassify::scaling_
svm_scaling scaling_
Definition svm_wrapper.h:127
pcl::SVMClassify::prob_
svm_problem prob_
Definition svm_wrapper.h:125
pcl::SVMClassify::scaleProblem
void scaleProblem(svm_problem &input, svm_scaling scaling)
It scales the input dataset using the model information.
pcl::SVMClassify::training_set_
std::vector< SVMData > training_set_
Definition svm_wrapper.h:124
pcl::SVMClassify::loadNormClassProblem
bool loadNormClassProblem(const char *filename)
Read in a normalized classification problem (in svmlight format).
Definition svm_wrapper.h:507
pcl::SVMClassify::getClassificationResult
void getClassificationResult(std::vector< std::vector< double > > &out)
Get the result of the classification.
Definition svm_wrapper.h:450
pcl::SVM
Base class for SVM SVM (Support Vector Machines).
Definition svm_wrapper.h:122
pcl::SVM::model_
SVMModel model_
Definition svm_wrapper.h:126
pcl::SVM::loadProblem
bool loadProblem(const char *filename, svm_problem &prob)
Load a problem from an extern file.
pcl::SVM::saveClassifierModel
void saveClassifierModel(const char *filename)
Save the classifier model in an extern file (in svmlight format).
Definition svm_wrapper.h:215
pcl::SVM::max_line_len_
int max_line_len_
Definition svm_wrapper.h:133
pcl::SVM::line_
char * line_
Definition svm_wrapper.h:132
pcl::SVM::readline
char * readline(FILE *input)
To read a line from the input file.
pcl::SVM::labelled_training_set_
bool labelled_training_set_
Definition svm_wrapper.h:134
pcl::SVM::adaptLibSVMToInput
void adaptLibSVMToInput(std::vector< SVMData > &training_set, svm_problem prob) const
Convert the libSVM format (svm_problem) into a easier output format.
pcl::SVM::getClassName
const std::string & getClassName() const
Get a string representation of the name of this class.
Definition svm_wrapper.h:155
pcl::SVM::~SVM
~SVM()
Destructor.
Definition svm_wrapper.h:185
pcl::SVM::adaptInputToLibSVM
void adaptInputToLibSVM(std::vector< SVMData > training_set, svm_problem &prob)
Convert the input format (vector of SVMData) into a readable format for libSVM.
pcl::SVM::class_name_
std::string class_name_
Definition svm_wrapper.h:130
pcl::SVM::saveProblem
bool saveProblem(const char *filename, bool labelled)
Save the raw problem in an extern file.
pcl::SVM::getLabel
void getLabel(std::vector< int > &labels)
Return the labels order from the classifier model.
Definition svm_wrapper.h:201
pcl::SVM::SVM
SVM()
Constructor.
Definition svm_wrapper.h:182
pcl::SVM::scaling_
svm_scaling scaling_
Definition svm_wrapper.h:127
pcl::SVM::param_
SVMParam param_
Definition svm_wrapper.h:129
pcl::SVM::prob_
svm_problem prob_
Definition svm_wrapper.h:125
pcl::SVM::exitInputError
void exitInputError(int line_num)
Outputs an error in file reading.
Definition svm_wrapper.h:147
pcl::SVM::training_set_
std::vector< SVMData > training_set_
Definition svm_wrapper.h:124
pcl::SVM::saveProblemNorm
bool saveProblemNorm(const char *filename, svm_problem prob_, bool labelled)
Save the problem (with normalized values) in an extern file.
pcl::SVM::printNull
static void printNull(const char *)
Set for output printings during classification.
Definition svm_wrapper.h:139
pcl::SVMTrain
SVM (Support Vector Machines) training class for the SVM machine learning.
Definition svm_wrapper.h:235
pcl::SVMTrain::model_
SVMModel model_
Definition svm_wrapper.h:126
pcl::SVMTrain::doCrossValidation
void doCrossValidation()
To cross validate the classifier.
pcl::SVMTrain::resetTrainingSet
void resetTrainingSet()
Reset the training set.
Definition svm_wrapper.h:319
pcl::SVMTrain::~SVMTrain
~SVMTrain()
Destructor.
Definition svm_wrapper.h:276
pcl::SVMTrain::cross_validation_
int cross_validation_
Set too 1 for cross validating the classifier.
Definition svm_wrapper.h:250
pcl::SVMTrain::getClassifierModel
SVMModel getClassifierModel()
Return the result of the training.
Definition svm_wrapper.h:298
pcl::SVMTrain::debug_
bool debug_
Set to 1 to see the training output.
Definition svm_wrapper.h:248
pcl::SVMTrain::setInputTrainingSet
void setInputTrainingSet(std::vector< SVMData > training_set)
It adds/store the training set with labelled data.
Definition svm_wrapper.h:305
pcl::SVMTrain::loadProblem
bool loadProblem(const char *filename)
Read in a problem (in svmlight format).
Definition svm_wrapper.h:336
pcl::SVMTrain::saveNormTrainingSet
bool saveNormTrainingSet(const char *filename)
Save the normalized training set in a file (in svmlight format).
Definition svm_wrapper.h:368
pcl::SVMTrain::saveTrainingSet
bool saveTrainingSet(const char *filename)
Save the raw training set in a file (in svmlight format).
Definition svm_wrapper.h:358
pcl::SVMTrain::trainClassifier
bool trainClassifier()
Start the training of the SVM classifier.
pcl::SVMTrain::setDebugMode
void setDebugMode(bool in)
Set to 1 for debugging info.
Definition svm_wrapper.h:343
pcl::SVMTrain::scaleFactors
void scaleFactors(std::vector< SVMData > training_set, svm_scaling &scaling)
It extracts scaling factors from the input training_set.
pcl::SVMTrain::setParameters
void setParameters(SVMParam param)
Change default training parameters (pcl::SVMParam).
Definition svm_wrapper.h:284
pcl::SVMTrain::class_name_
std::string class_name_
Definition svm_wrapper.h:130
pcl::SVMTrain::param_
SVMParam param_
Definition svm_wrapper.h:129
pcl::SVMTrain::prob_
svm_problem prob_
Definition svm_wrapper.h:125
pcl::SVMTrain::training_set_
std::vector< SVMData > training_set_
Definition svm_wrapper.h:124
pcl::SVMTrain::nr_fold_
int nr_fold_
Number of folds to be used during cross validation.
Definition svm_wrapper.h:253
pcl::SVMTrain::getInputTrainingSet
std::vector< SVMData > getInputTrainingSet()
Return the current training set.
Definition svm_wrapper.h:312
pcl::SVMTrain::getParameters
SVMParam getParameters()
Return the current training parameters.
Definition svm_wrapper.h:291
pcl::SVMTrain::SVMTrain
SVMTrain()
Constructor.
Definition svm_wrapper.h:268
pcl
Definition convolution.h:46
pcl::SVMData
The structure stores the features and the label of a single sample which has to be used for the train...
Definition svm_wrapper.h:112
pcl::SVMData::SV
std::vector< pcl::SVMDataPoint > SV
Vector of features for the specific sample.
Definition svm_wrapper.h:116
pcl::SVMData::SVMData
SVMData()
Definition svm_wrapper.h:118
pcl::SVMData::label
double label
Pointer to the label value. It is a mandatory to train the classifier.
Definition svm_wrapper.h:114
pcl::SVMDataPoint
The structure initialize a single feature value for the classification using SVM (Support Vector Mach...
Definition svm_wrapper.h:100
pcl::SVMDataPoint::idx
int idx
It's the feature index. It has to be an integer number greater or equal to zero.
Definition svm_wrapper.h:102
pcl::SVMDataPoint::value
float value
The value assigned to the correspondent feature.
Definition svm_wrapper.h:104
pcl::SVMDataPoint::SVMDataPoint
SVMDataPoint()=default
pcl::SVMModel
The structure initialize a model created by the SVM (Support Vector Machines) classifier (pcl::SVMTra...
Definition svm_wrapper.h:88
pcl::SVMModel::SVMModel
SVMModel()
Definition svm_wrapper.h:89
pcl::SVMParam
The structure stores the parameters for the classificationa nd must be initialized and passed to the ...
Definition svm_wrapper.h:62
pcl::SVMParam::SVMParam
SVMParam()
Definition svm_wrapper.h:63
svm_model
Definition svm.h:99
svm_model::scaling
struct svm_node * scaling
Definition svm.h:122
svm_model::probB
double * probB
Definition svm.h:109
svm_model::l
int l
Definition svm.h:103
svm_model::probA
double * probA
Definition svm.h:108
svm_node
Definition svm.h:49
svm_node::index
int index
Definition svm.h:50
svm_parameter
Definition svm.h:75
svm_parameter::cache_size
double cache_size
Definition svm.h:83
svm_parameter::weight_label
int * weight_label
Definition svm.h:87
svm_parameter::eps
double eps
Definition svm.h:84
svm_parameter::coef0
double coef0
Definition svm.h:80
svm_parameter::svm_type
int svm_type
Definition svm.h:76
svm_parameter::p
double p
Definition svm.h:90
svm_parameter::kernel_type
int kernel_type
Definition svm.h:77
svm_parameter::nr_weight
int nr_weight
Definition svm.h:86
svm_parameter::nu
double nu
Definition svm.h:89
svm_parameter::gamma
double gamma
Definition svm.h:79
svm_parameter::C
double C
Definition svm.h:85
svm_parameter::probability
int probability
Definition svm.h:92
svm_parameter::shrinking
int shrinking
Definition svm.h:91
svm_parameter::degree
int degree
Definition svm.h:78
svm_parameter::weight
double * weight
Definition svm.h:88
svm_problem
Definition svm.h:54
svm_problem::l
int l
Definition svm.h:55
svm_problem::y
double * y
Definition svm.h:56
svm_problem::x
struct svm_node ** x
Definition svm.h:58
svm_scaling
Definition svm.h:61
svm_scaling::obj
struct svm_node * obj
Definition svm.h:64
svm_scaling::max
int max
Definition svm.h:67