#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. | |
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. | |
virtual void | reset () |
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 &=NIL_ID) |
Protected Attributes | |
pcLearnModel | 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 40 of file aggregating.h.
|
Definition at line 48 of file aggregating.h. |
|
Definition at line 25 of file aggregating.cpp. References Aggregating::lm, and Aggregating::n_in_agg. |
|
Definition at line 71 of file aggregating.h. References Aggregating::n_in_agg. |
|
Definition at line 57 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, AdaBoost_ERP, 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, AdaBoost_ERP, Bagging, Boosting, Cascade, CGBoost, LPBoost, MgnBoost, and MultiClass_ECOC. |
|
Definition at line 65 of file aggregating.h. References Aggregating::lm. |
|
Definition at line 66 of file aggregating.h. References Aggregating::lm. |
|
Definition at line 36 of file aggregating.cpp. References Aggregating::lm, Aggregating::lm_base, Aggregating::max_n_model, and Aggregating::n_in_agg. |
|
Definition at line 67 of file aggregating.h. References Aggregating::lm. |
|
Delete learning models stored in lm. This is only used in operator= and load().
Reimplemented from LearnModel. Reimplemented in Boosting, CGBoost, and MultiClass_ECOC. Definition at line 15 of file aggregating.cpp. References Aggregating::lm, Aggregating::lm_base, Aggregating::n_in_agg, LearnModel::reset(), and LearnModel::valid_dimensions(). Referenced by MultiClass_ECOC::reset(), and Boosting::reset(). |
|
Reimplemented from LearnModel. Reimplemented in Boosting, Cascade, CGBoost, and MultiClass_ECOC. Definition at line 53 of file aggregating.cpp. References Aggregating::lm, Aggregating::lm_base, and SERIALIZE_PARENT. |
|
Specify the number of hypotheses used in aggregating.
Reimplemented in CGBoost, and LPBoost. Definition at line 114 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 102 of file aggregating.cpp. References LearnModel::clone(), Aggregating::lm_base, and LearnModel::valid_dimensions(). |
|
Definition at line 60 of file aggregating.h. References Aggregating::max_n_model. Referenced by 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 122 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 64 of file aggregating.h. References Aggregating::lm. Referenced by _boost_gd::_boost_gd(), MultiClass_ECOC::ECOC_partition(), Bagging::operator()(), MultiClass_ECOC::serialize(), CGBoost::serialize(), CGBoost::set_aggregation_size(), Aggregating::set_aggregation_size(), MultiClass_ECOC::set_ECOC_table(), Boosting::train(), Bagging::train(), and CGBoost::unserialize(). |
|
Reimplemented from LearnModel. Reimplemented in Boosting, Cascade, CGBoost, and MultiClass_ECOC. Definition at line 66 of file aggregating.cpp. References LearnModel::_n_in, LearnModel::_n_out, Object::create(), LearnModel::exact_dimensions(), Aggregating::lm, Aggregating::lm_base, Object::NIL_ID, UNSERIALIZE_PARENT, and LearnModel::valid_dimensions(). |
|
|
The base learning model.
Definition at line 42 of file aggregating.h. Referenced by Aggregating::base_model(), Aggregating::operator=(), Aggregating::reset(), Aggregating::serialize(), Aggregating::set_base_model(), MultiClass_ECOC::train(), LPBoost::train(), Boosting::train(), Bagging::train(), AdaBoost_ECOC::train_with_full_partition(), AdaBoost_ERP::train_with_partial_partition(), MultiClass_ECOC::train_with_partition(), Boosting::train_with_smpwgt(), and Aggregating::unserialize(). |
|
Maximal # of models allowed.
Definition at line 45 of file aggregating.h. Referenced by _boost_gd::_boost_gd(), Aggregating::operator=(), MultiClass_ECOC::set_ECOC_table(), Aggregating::set_max_models(), MultiClass_ECOC::train(), Boosting::train(), Bagging::train(), and Boosting::train_with_smpwgt(). |
|