Go to the documentation of this file.
12 #ifndef MLPACK_METHODS_ADABOOST_ADABOOST_MODEL_HPP
13 #define MLPACK_METHODS_ADABOOST_ADABOOST_MODEL_HPP
37 arma::Col<size_t> mappings;
39 size_t weakLearnerType;
45 size_t dimensionality;
53 const size_t weakLearnerType);
68 const arma::Col<size_t>&
Mappings()
const {
return mappings; }
70 arma::Col<size_t>&
Mappings() {
return mappings; }
83 void Train(
const arma::mat& data,
84 const arma::Row<size_t>& labels,
85 const size_t numClasses,
86 const size_t iterations,
87 const double tolerance);
91 arma::Row<size_t>& predictions);
95 arma::Row<size_t>& predictions,
96 arma::mat& probabilities);
99 template<
typename Archive>
102 if (Archive::is_loading::value)
113 ar & BOOST_SERIALIZATION_NVP(mappings);
114 ar & BOOST_SERIALIZATION_NVP(weakLearnerType);
115 if (weakLearnerType == WeakLearnerTypes::DECISION_STUMP)
116 ar & BOOST_SERIALIZATION_NVP(dsBoost);
117 else if (weakLearnerType == WeakLearnerTypes::PERCEPTRON)
118 ar & BOOST_SERIALIZATION_NVP(pBoost);
119 ar & BOOST_SERIALIZATION_NVP(dimensionality);
void Classify(const arma::mat &testData, arma::Row< size_t > &predictions, arma::mat &probabilities)
Classify test points.
AdaBoostModel()
Create an empty AdaBoost model.
~AdaBoostModel()
Clean up memory.
void Classify(const arma::mat &testData, arma::Row< size_t > &predictions)
Classify test points.
Linear algebra utility functions, generally performed on matrices or vectors.
void serialize(Archive &ar, const unsigned int)
Serialize the model.
size_t & Dimensionality()
Modify the dimensionality of the model.
void Train(const arma::mat &data, const arma::Row< size_t > &labels, const size_t numClasses, const size_t iterations, const double tolerance)
Train the model, treat the data is all of the numeric type.
AdaBoostModel & operator=(const AdaBoostModel &other)
Copy assignment operator.
size_t WeakLearnerType() const
Get the weak learner type.
arma::Col< size_t > & Mappings()
Modify the mappings.
size_t & WeakLearnerType()
Modify the weak learner type.
The model to save to disk.
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...
const arma::Col< size_t > & Mappings() const
Get the mappings.
AdaBoostModel(const AdaBoostModel &other)
Copy constructor.
AdaBoostModel(const arma::Col< size_t > &mappings, const size_t weakLearnerType)
Create the AdaBoost model with the given mappings and type.
AdaBoostModel(AdaBoostModel &&other)
Move constructor.
size_t Dimensionality() const
Get the dimensionality of the model.