#include <bagging.h>
Inheritance diagram for Bagging:
Public Member Functions | |
Bagging () | |
Bagging (const Aggregating &s) | |
Bagging (std::istream &is) | |
virtual const id_t & | id () const |
virtual Bagging * | create () const |
Create a new object using the default constructor. | |
virtual Bagging * | clone () const |
Create a new object by replicating itself. | |
virtual bool | support_weighted_data () const |
Whether the learning model/algorithm supports unequally weighted data. | |
virtual void | train () |
Train with preset data set and sample weight. | |
virtual Output | operator() (const Input &) const |
virtual REAL | margin_norm () const |
The normalization term for margins. | |
virtual REAL | margin_of (const Input &, const Output &) const |
Report the (unnormalized) margin of an example (x, y). |
Bagging averages over all hypotheses.
Definition at line 20 of file bagging.h.
|
Definition at line 22 of file bagging.h. Referenced by Bagging::clone(), and Bagging::create(). |
|
|
|
|
|
Create a new object by replicating itself.
return new Derived(*this);
Implements Aggregating. Definition at line 28 of file bagging.h. References Bagging::Bagging(). |
|
Create a new object using the default constructor. The code for a derived class Derived is always return new Derived(); Implements Aggregating. Definition at line 27 of file bagging.h. References Bagging::Bagging(). |
|
Implements Object. |
|
The normalization term for margins. The margin concept can be normalized or unnormalized. For example, for a perceptron model, the unnormalized margin would be the wegithed sum of the input features, and the normalized margin would be the distance to the hyperplane, and the normalization term is the norm of the hyperplane weight. Since the normalization term is usually a constant, it would be more efficient if it is precomputed instead of being calculated every time when a margin is asked for. The best way is to use a cache. Here I use a easier way: let the users decide when to compute the normalization term. Reimplemented from LearnModel. Definition at line 46 of file bagging.cpp. References Aggregating::n_in_agg. |
|
Report the (unnormalized) margin of an example (x, y).
Reimplemented from LearnModel. Definition at line 50 of file bagging.cpp. References INFINITESIMAL. |
|
Implements LearnModel. Definition at line 13 of file bagging.cpp. References LearnModel::_n_out, LearnModel::exact_dimensions(), Aggregating::lm, Aggregating::n_in_agg, and Aggregating::size(). |
|
Whether the learning model/algorithm supports unequally weighted data.
Reimplemented from LearnModel. |
|
Train with preset data set and sample weight.
Implements LearnModel. Definition at line 27 of file bagging.cpp. References Aggregating::lm, Aggregating::lm_base, Aggregating::max_n_model, Aggregating::n_in_agg, LearnModel::n_samples, LearnModel::ptd, LearnModel::ptw, LearnModel::set_dimensions(), LearnModel::set_train_data(), Aggregating::size(), LearnModel::train(), and VERBOSE_OUTPUT. |