7 #ifndef MLPACK_METHODS_ADABOOST_ADABOOST_MODEL_HPP 8 #define MLPACK_METHODS_ADABOOST_ADABOOST_MODEL_HPP 46 const size_t weakLearnerType);
76 void Train(
const arma::mat& data,
77 const arma::Row<size_t>& labels,
78 const size_t iterations,
79 const double tolerance);
82 void Classify(
const arma::mat& testData, arma::Row<size_t>& predictions);
85 template<
typename Archive>
88 if (Archive::is_loading::value)
101 if (weakLearnerType == WeakLearnerTypes::DECISION_STUMP)
103 else if (weakLearnerType == WeakLearnerTypes::PERCEPTRON)
arma::Col< size_t > mappings
The mappings for the labels.
Linear algebra utility functions, generally performed on matrices or vectors.
AdaBoost< perceptron::Perceptron<> > * pBoost
Non-NULL if using perceptrons.
FirstShim< T > CreateNVP(T &t, const std::string &name, typename std::enable_if_t< HasSerialize< T >::value > *=0)
Call this function to produce a name-value pair; this is similar to BOOST_SERIALIZATION_NVP(), but should be used for types that have a Serialize() function (or contain a type that has a Serialize() function) instead of a serialize() function.
size_t weakLearnerType
The type of weak learner.
size_t & Dimensionality()
Modify the dimensionality of the model.
AdaBoostModel & operator=(const AdaBoostModel &other)
Copy assignment operator.
size_t & WeakLearnerType()
Modify the weak learner type.
void Train(const arma::mat &data, const arma::Row< size_t > &labels, const size_t iterations, const double tolerance)
Train the model.
size_t Dimensionality() const
Get the dimensionality of the model.
AdaBoostModel()
Create an empty AdaBoost model.
~AdaBoostModel()
Clean up memory.
arma::Col< size_t > & Mappings()
Modify the mappings.
The model to save to disk.
void Classify(const arma::mat &testData, arma::Row< size_t > &predictions)
Classify test points.
size_t WeakLearnerType() const
Get the weak learner type.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
size_t dimensionality
Number of dimensions in training data.
const arma::Col< size_t > & Mappings() const
Get the mappings.
AdaBoost< decision_stump::DecisionStump<> > * dsBoost
Non-NULL if using decision stumps.
void Serialize(Archive &ar, const unsigned int)
Serialize the model.