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);
71 const arma::Col<size_t>&
Mappings()
const {
return mappings; }
73 arma::Col<size_t>&
Mappings() {
return mappings; }
86 void Train(
const arma::mat& data,
87 const arma::Row<size_t>& labels,
88 const size_t numClasses,
89 const size_t iterations,
90 const double tolerance);
93 void Classify(
const arma::mat& testData,
94 arma::Row<size_t>& predictions);
97 void Classify(
const arma::mat& testData,
98 arma::Row<size_t>& predictions,
99 arma::mat& probabilities);
102 template<
typename Archive>
105 if (cereal::is_loading<Archive>())
116 ar(CEREAL_NVP(mappings));
117 ar(CEREAL_NVP(weakLearnerType));
118 if (weakLearnerType == WeakLearnerTypes::DECISION_STUMP)
120 else if (weakLearnerType == WeakLearnerTypes::PERCEPTRON)
122 ar(CEREAL_NVP(dimensionality));
~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 uint32_t)
Serialize the model.
size_t & Dimensionality()
Modify the dimensionality of the model.
The model to save to disk.
arma::Col< size_t > & Mappings()
Modify the mappings.
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.
Include all of the base components required to write mlpack methods, and the main mlpack Doxygen docu...
size_t WeakLearnerType() const
Get the weak learner type.
AdaBoostModel()
Create an empty AdaBoost model.
#define CEREAL_POINTER(T)
Cereal does not support the serialization of raw pointer.
const arma::Col< size_t > & Mappings() const
Get the mappings.
AdaBoostModel & operator=(const AdaBoostModel &other)
Copy assignment operator.
size_t Dimensionality() const
Get the dimensionality of the model.
size_t & WeakLearnerType()
Modify the weak learner type.