Bagging Class Reference

Bagging (boostrap aggregating). More...

#include <bagging.h>

Inheritance diagram for Bagging:

Inheritance graph
[legend]
Collaboration diagram for Bagging:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Bagging ()
 Bagging (const Aggregating &s)
 Bagging (std::istream &is)
virtual const id_tid () const
virtual Baggingcreate () const
 Create a new object using the default constructor.
virtual Baggingclone () 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).

Detailed Description

Bagging (boostrap aggregating).

Bagging averages over all hypotheses.

Todo:
Documentation

Definition at line 20 of file bagging.h.


Constructor & Destructor Documentation

Bagging  )  [inline]
 

Definition at line 22 of file bagging.h.

Referenced by Bagging::clone(), and Bagging::create().

Bagging const Aggregating s  )  [inline]
 

Definition at line 23 of file bagging.h.

Bagging std::istream &  is  )  [inline, explicit]
 

Definition at line 24 of file bagging.h.


Member Function Documentation

virtual Bagging* clone  )  const [inline, virtual]
 

Create a new object by replicating itself.

Returns:
A pointer to the new copy.
The code for a derived class Derived is always
 return new Derived(*this); 
Though seemingly redundant, it helps to copy an object without knowing the real type of the object.
See also:
C++ FAQ Lite 20.6

Implements Aggregating.

Definition at line 28 of file bagging.h.

References Bagging::Bagging().

virtual Bagging* create  )  const [inline, virtual]
 

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().

virtual const id_t& id  )  const [virtual]
 

Returns:
Class ID string (class name)

Implements Object.

REAL margin_norm  )  const [virtual]
 

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.

REAL margin_of const Input ,
const Output
const [virtual]
 

Report the (unnormalized) margin of an example (x, y).

Reimplemented from LearnModel.

Definition at line 50 of file bagging.cpp.

References INFINITESIMAL.

Output operator() const Input  )  const [virtual]
 

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().

virtual bool support_weighted_data  )  const [inline, virtual]
 

Whether the learning model/algorithm supports unequally weighted data.

Returns:
true if supporting; false otherwise. The default is false, just for safety.
See also:
set_train_data()

Reimplemented from LearnModel.

Definition at line 30 of file bagging.h.

void train  )  [virtual]
 

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.


The documentation for this class was generated from the following files:
Generated on Wed Nov 8 08:16:41 2006 for LEMGA by  doxygen 1.4.6