#include <aggregating.h>
Inheritance diagram for Aggregating:
Public Member Functions | |
Aggregating () | |
Aggregating (const Aggregating &) | |
const Aggregating & | operator= (const Aggregating &) |
virtual Aggregating * | create () const =0 |
Create a new object using the default constructor. | |
virtual Aggregating * | clone () const =0 |
Create a new object by replicating itself. | |
virtual void | initialize () |
Initialize the model for training. | |
void | set_max_models (UINT max) |
virtual bool | set_aggregation_size (UINT) |
Specify the number of hypotheses used in aggregating. | |
UINT | aggregation_size () const |
virtual void | set_train_data (const pDataSet &, const pDataWgt &=0) |
Set the data set and sample weight to be used in training. | |
void | set_base_model (const LearnModel &) |
Set the base learning model. | |
const LearnModel & | base_model () const |
UINT | size () const |
Total number of hypotheses. | |
bool | empty () const |
const LearnModel & | model (UINT n) const |
const LearnModel & | operator[] (UINT n) const |
Protected Member Functions | |
virtual bool | serialize (std::ostream &, ver_list &) const |
virtual bool | unserialize (std::istream &, ver_list &, const id_t &=empty_id) |
Protected Attributes | |
pLearnModel | lm_base |
The base learning model. | |
std::vector< pLearnModel > | lm |
Pointers to learning models. | |
UINT | n_in_agg |
# of models in aggregating | |
UINT | max_n_model |
Maximal # of models allowed. |
Aggregating in learning stands for a series of techniques which generate several hypotheses and combine them into a large and usually better one. Bagging and AdaBoost are two famous examples of such techniques. This class provides member functions to store and retrieve hypotheses used in aggregating.
The class has a vector of hypotheses, and a base learning model, which is the ``parent'' of all those hypotheses. For users of this class, a possible calling order for training is
Aggregating *ag = new Some_Aggregating_Method (6, 5);
ag->set_base_model(a_neural_net);
We do not provide...?
Definition at line 43 of file aggregating.h.
|
Definition at line 21 of file aggregating.cpp. |
|
Definition at line 29 of file aggregating.cpp. References Aggregating::lm, Aggregating::lm_base, and Aggregating::n_in_agg. |
|
Definition at line 77 of file aggregating.h. References Aggregating::n_in_agg. |
|
Definition at line 62 of file aggregating.h. References Aggregating::lm_base. |
|
Create a new object by replicating itself.
return new Derived(*this);
Implements LearnModel. Implemented in AdaBoost, AdaBoost_ECOC, Bagging, Boosting, Cascade, CGBoost, LPBoost, MgnBoost, and MultiClass_ECOC. |
|
Create a new object using the default constructor. The code for a derived class Derived is always return new Derived(); Implements LearnModel. Implemented in AdaBoost, AdaBoost_ECOC, Bagging, Boosting, Cascade, CGBoost, LPBoost, MgnBoost, and MultiClass_ECOC. |
|
Definition at line 71 of file aggregating.h. References Aggregating::lm. Referenced by LPBoost::train(), Boosting::train(), and Bagging::train(). |
|
Initialize the model for training.
Reimplemented from LearnModel. Reimplemented in Boosting, CGBoost, and MultiClass_ECOC. Definition at line 134 of file aggregating.cpp. References Aggregating::lm_base. Referenced by MultiClass_ECOC::initialize(), and Boosting::initialize(). |
|
Definition at line 72 of file aggregating.h. References Aggregating::lm. |
|
Definition at line 41 of file aggregating.cpp. References Aggregating::lm, Aggregating::lm_base, Aggregating::max_n_model, and Aggregating::n_in_agg. |
|
Definition at line 73 of file aggregating.h. References Aggregating::lm. |
|
Reimplemented from LearnModel. Reimplemented in Boosting, Cascade, CGBoost, and MultiClass_ECOC. Definition at line 59 of file aggregating.cpp. References Aggregating::lm, Aggregating::lm_base, and SERIALIZE_PARENT. |
|
Specify the number of hypotheses used in aggregating.
Reimplemented in CGBoost. Definition at line 126 of file aggregating.cpp. References Aggregating::n_in_agg, and Aggregating::size(). Referenced by CGBoost::set_aggregation_size(). |
|
Set the base learning model.
Definition at line 111 of file aggregating.cpp. References LearnModel::_n_in, LearnModel::_n_out, LearnModel::clone(), Aggregating::lm_base, LearnModel::n_input(), and LearnModel::n_output(). |
|
Definition at line 66 of file aggregating.h. References Aggregating::max_n_model. Referenced by Bagging::Bagging(), and MultiClass_ECOC::set_ECOC_table(). |
|
Set the data set and sample weight to be used in training.
If the learning model/algorithm can only do training using uniform sample weight, i.e., support_weighted_data() returns
In order to make the life easier, when support_weighted_data() returns
Reimplemented from LearnModel. Reimplemented in Boosting, and MultiClass_ECOC. Definition at line 140 of file aggregating.cpp. References Aggregating::lm, LearnModel::ptd, LearnModel::ptw, and LearnModel::set_train_data(). Referenced by MultiClass_ECOC::set_train_data(), and Boosting::set_train_data(). |
|
Total number of hypotheses.
Definition at line 70 of file aggregating.h. References Aggregating::lm. Referenced by MultiClass_ECOC::ECOC_partition(), Bagging::operator()(), MultiClass_ECOC::serialize(), CGBoost::serialize(), CGBoost::set_aggregation_size(), Aggregating::set_aggregation_size(), MultiClass_ECOC::set_ECOC_table(), and CGBoost::unserialize(). |
|
Reimplemented from LearnModel. Reimplemented in Boosting, Cascade, CGBoost, and MultiClass_ECOC. Definition at line 72 of file aggregating.cpp. References LearnModel::_n_in, LearnModel::_n_out, Object::create(), Object::empty_id, Aggregating::lm, Aggregating::lm_base, and UNSERIALIZE_PARENT. |
|
|
The base learning model.
Definition at line 47 of file aggregating.h. Referenced by Aggregating::Aggregating(), Aggregating::base_model(), Aggregating::initialize(), Aggregating::operator=(), Aggregating::serialize(), Aggregating::set_base_model(), MultiClass_ECOC::set_train_data(), MultiClass_ECOC::train(), LPBoost::train(), Boosting::train(), Bagging::train(), MultiClass_ECOC::train_with_partition(), AdaBoost_ECOC::train_with_partition(), Boosting::train_with_smpwgt(), and Aggregating::unserialize(). |
|
Maximal # of models allowed.
Definition at line 50 of file aggregating.h. Referenced by Aggregating::operator=(), MultiClass_ECOC::set_ECOC_table(), Aggregating::set_max_models(), _boost_gd::stop_opt(), MultiClass_ECOC::train(), Boosting::train(), Bagging::train(), and Boosting::train_with_smpwgt(). |
|