30 #ifndef __MLPACK_METHODS_ADABOOST_ADABOOST_HPP
31 #define __MLPACK_METHODS_ADABOOST_ADABOOST_HPP
81 template<
typename WeakLearnerType = mlpack::perceptron::Perceptron<>,
82 typename MatType = arma::mat>
99 const arma::Row<size_t>& labels,
100 const WeakLearnerType& other,
101 const size_t iterations = 100,
145 void Train(
const MatType& data,
146 const arma::Row<size_t>& labels,
147 const WeakLearnerType& learner,
148 const size_t iterations = 100,
158 void Classify(
const MatType& test, arma::Row<size_t>& predictedLabels);
163 template<
typename Archive>
164 void Serialize(Archive& ar,
const unsigned int );
173 std::vector<WeakLearnerType>
wl;
185 #include "adaboost_impl.hpp"
size_t WeakLearners() const
Get the number of weak learners in the model.
std::vector< WeakLearnerType > wl
The vector of weak learners.
Linear algebra utility functions, generally performed on matrices or vectors.
WeakLearnerType & WeakLearner(const size_t i)
Modify the given weak learner (be careful!).
double Alpha(const size_t i) const
Get the weights for the given weak learner.
double & Alpha(const size_t i)
Modify the weight for the given weak learner (be careful!).
void Train(const MatType &data, const arma::Row< size_t > &labels, const WeakLearnerType &learner, const size_t iterations=100, const double tolerance=1e-6)
Train AdaBoost on the given dataset.
void Classify(const MatType &test, arma::Row< size_t > &predictedLabels)
Classify the given test points.
const WeakLearnerType & WeakLearner(const size_t i) const
Get the given weak learner.
size_t classes
The number of classes in the model.
Include all of the base components required to write MLPACK methods, and the main MLPACK Doxygen docu...
size_t Classes() const
Get the number of classes this model is trained on.
double Tolerance() const
Get the tolerance for stopping the optimization during training.
double & Tolerance()
Modify the tolerance for stopping the optimization during training.
std::vector< double > alpha
The weights corresponding to each weak learner.
double ztProduct
To check for the bound for the Hamming loss.
AdaBoost(const MatType &data, const arma::Row< size_t > &labels, const WeakLearnerType &other, const size_t iterations=100, const double tolerance=1e-6)
Constructor.
void Serialize(Archive &ar, const unsigned int)
Serialize the AdaBoost model.