mlpack  master
Public Types | Public Member Functions | Private Attributes | List of all members
mlpack::adaboost::AdaBoostModel Class Reference

The model to save to disk. More...

Public Types

enum  WeakLearnerTypes {
  DECISION_STUMP,
  PERCEPTRON
}
 

Public Member Functions

 AdaBoostModel ()
 Create an empty AdaBoost model. More...
 
 AdaBoostModel (const arma::Col< size_t > &mappings, const size_t weakLearnerType)
 Create the AdaBoost model with the given mappings and type. More...
 
 AdaBoostModel (const AdaBoostModel &other)
 Copy constructor. More...
 
 AdaBoostModel (AdaBoostModel &&other)
 Move constructor. More...
 
 ~AdaBoostModel ()
 Clean up memory. More...
 
void Classify (const arma::mat &testData, arma::Row< size_t > &predictions)
 Classify test points. More...
 
size_t Dimensionality () const
 Get the dimensionality of the model. More...
 
size_t & Dimensionality ()
 Modify the dimensionality of the model. More...
 
const arma::Col< size_t > & Mappings () const
 Get the mappings. More...
 
arma::Col< size_t > & Mappings ()
 Modify the mappings. More...
 
AdaBoostModeloperator= (const AdaBoostModel &other)
 Copy assignment operator. More...
 
template<typename Archive >
void Serialize (Archive &ar, const unsigned int)
 Serialize the model. More...
 
void Train (const arma::mat &data, const arma::Row< size_t > &labels, const size_t iterations, const double tolerance)
 Train the model. More...
 
size_t WeakLearnerType () const
 Get the weak learner type. More...
 
size_t & WeakLearnerType ()
 Modify the weak learner type. More...
 

Private Attributes

size_t dimensionality
 Number of dimensions in training data. More...
 
AdaBoost< decision_stump::DecisionStump<> > * dsBoost
 Non-NULL if using decision stumps. More...
 
arma::Col< size_t > mappings
 The mappings for the labels. More...
 
AdaBoost< perceptron::Perceptron<> > * pBoost
 Non-NULL if using perceptrons. More...
 
size_t weakLearnerType
 The type of weak learner. More...
 

Detailed Description

The model to save to disk.

Definition at line 19 of file adaboost_model.hpp.

Member Enumeration Documentation

Enumerator
DECISION_STUMP 
PERCEPTRON 

Definition at line 22 of file adaboost_model.hpp.

Constructor & Destructor Documentation

mlpack::adaboost::AdaBoostModel::AdaBoostModel ( )

Create an empty AdaBoost model.

mlpack::adaboost::AdaBoostModel::AdaBoostModel ( const arma::Col< size_t > &  mappings,
const size_t  weakLearnerType 
)

Create the AdaBoost model with the given mappings and type.

mlpack::adaboost::AdaBoostModel::AdaBoostModel ( const AdaBoostModel other)

Copy constructor.

mlpack::adaboost::AdaBoostModel::AdaBoostModel ( AdaBoostModel &&  other)

Move constructor.

mlpack::adaboost::AdaBoostModel::~AdaBoostModel ( )

Clean up memory.

Member Function Documentation

void mlpack::adaboost::AdaBoostModel::Classify ( const arma::mat &  testData,
arma::Row< size_t > &  predictions 
)

Classify test points.

Referenced by Dimensionality().

size_t mlpack::adaboost::AdaBoostModel::Dimensionality ( ) const
inline

Get the dimensionality of the model.

Definition at line 71 of file adaboost_model.hpp.

References dimensionality.

size_t& mlpack::adaboost::AdaBoostModel::Dimensionality ( )
inline

Modify the dimensionality of the model.

Definition at line 73 of file adaboost_model.hpp.

References Classify(), dimensionality, and Train().

const arma::Col<size_t>& mlpack::adaboost::AdaBoostModel::Mappings ( ) const
inline

Get the mappings.

Definition at line 61 of file adaboost_model.hpp.

References mappings.

arma::Col<size_t>& mlpack::adaboost::AdaBoostModel::Mappings ( )
inline

Modify the mappings.

Definition at line 63 of file adaboost_model.hpp.

References mappings.

AdaBoostModel& mlpack::adaboost::AdaBoostModel::operator= ( const AdaBoostModel other)

Copy assignment operator.

template<typename Archive >
void mlpack::adaboost::AdaBoostModel::Serialize ( Archive &  ar,
const unsigned  int 
)
inline

Serialize the model.

Definition at line 86 of file adaboost_model.hpp.

References mlpack::data::CreateNVP(), dsBoost, and pBoost.

void mlpack::adaboost::AdaBoostModel::Train ( const arma::mat &  data,
const arma::Row< size_t > &  labels,
const size_t  iterations,
const double  tolerance 
)

Train the model.

Referenced by Dimensionality().

size_t mlpack::adaboost::AdaBoostModel::WeakLearnerType ( ) const
inline

Get the weak learner type.

Definition at line 66 of file adaboost_model.hpp.

References weakLearnerType.

size_t& mlpack::adaboost::AdaBoostModel::WeakLearnerType ( )
inline

Modify the weak learner type.

Definition at line 68 of file adaboost_model.hpp.

References weakLearnerType.

Member Data Documentation

size_t mlpack::adaboost::AdaBoostModel::dimensionality
private

Number of dimensions in training data.

Definition at line 38 of file adaboost_model.hpp.

Referenced by Dimensionality().

AdaBoost<decision_stump::DecisionStump<> >* mlpack::adaboost::AdaBoostModel::dsBoost
private

Non-NULL if using decision stumps.

Definition at line 34 of file adaboost_model.hpp.

Referenced by Serialize().

arma::Col<size_t> mlpack::adaboost::AdaBoostModel::mappings
private

The mappings for the labels.

Definition at line 30 of file adaboost_model.hpp.

Referenced by Mappings().

AdaBoost<perceptron::Perceptron<> >* mlpack::adaboost::AdaBoostModel::pBoost
private

Non-NULL if using perceptrons.

Definition at line 36 of file adaboost_model.hpp.

Referenced by Serialize().

size_t mlpack::adaboost::AdaBoostModel::weakLearnerType
private

The type of weak learner.

Definition at line 32 of file adaboost_model.hpp.

Referenced by WeakLearnerType().


The documentation for this class was generated from the following file: