Cascade Class Reference

Aggregate hypotheses in a cascade (sequential) way. More...

#include <cascade.h>

Inheritance diagram for Cascade:

Inheritance graph
[legend]
Collaboration diagram for Cascade:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual Cascadecreate () const =0
 Create a new object using the default constructor.
virtual Cascadeclone () const =0
 Create a new object by replicating itself.
virtual bool support_weighted_data () const
virtual void train ()=0
 Train with preset data set and sample weight.
virtual Output operator() (const Input &) const
virtual REAL belief (const LearnModel &, const Input &, const Output &) const
 Belief at a specific pair of input and output.

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

std::vector< REALupper_margin
std::vector< REALlower_margin

Detailed Description

Aggregate hypotheses in a cascade (sequential) way.

For classification problems, aggregating of hypotheses can be done in a cascade way. That is, a list of classifiers are trained from the training data; an unknown input is first classified using the first hypothesis in the list. If the first hypothesis cannot decide the classification with high reliability, the input is fed into the next one and so on. (See Cascade::operator() for details.) We can have as many hypotheses as the problem demands.

The ``reliability'' of a decision is usually determined by a concept named margin. There exist different definitions in literature, such as $yf(x)$ in AdaBoost, $y(w\cdot x-t)/|w|$ in SVM. Despite of the differences in definitions, higher margins usually implicit more robustness to input disturbance and thus better generalization.

When margin is used in cascade to decide whether to go on to the next hypothesis, the real output y is unknown. A natual alternative is to use the ``sign'' part of the margin, i.e., $f(x)$ in AdaBoost and $(w\cdot x-t)/|w|$ in SVM, and take the magnitude as the margin. Similar concepts, such as belief in belief propagation and log-likelihood in coding, can also be used.

We use the name ``belief'' in this class for binary-class problems. Very positive and very negative beliefs indicate strong confidence in the predicting and thus high reliability.

Todo:
General definition of margin; More explanation of Cascade

Definition at line 47 of file cascade.h.


Member Function Documentation

REAL belief const LearnModel l,
const Input x,
const Output y
const [virtual]
 

Belief at a specific pair of input and output.

We use the ``sign'' part of margin in AdaBoost

Definition at line 58 of file cascade.cpp.

References LearnModel::n_output().

Referenced by Cascade::operator()().

virtual Cascade* clone  )  const [pure 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.

virtual Cascade* create  )  const [pure virtual]
 

Create a new object using the default constructor.

The code for a derived class Derived is always

 return new Derived(); 

Implements Aggregating.

Output operator() const Input  )  const [virtual]
 

Implements LearnModel.

Definition at line 40 of file cascade.cpp.

References Cascade::belief(), Aggregating::lm, Cascade::lower_margin, Aggregating::n_in_agg, and Cascade::upper_margin.

bool serialize std::ostream &  ,
ver_list
const [protected, virtual]
 

Reimplemented from Aggregating.

Definition at line 10 of file cascade.cpp.

References Aggregating::lm, Cascade::lower_margin, SERIALIZE_PARENT, and Cascade::upper_margin.

virtual bool support_weighted_data  )  const [inline, virtual]
 

Todo:
Unclear about the support of weghted data

Reimplemented from LearnModel.

Definition at line 57 of file cascade.h.

virtual void train  )  [pure virtual]
 

Train with preset data set and sample weight.

Implements LearnModel.

bool unserialize std::istream &  ,
ver_list ,
const id_t = NIL_ID
[protected, virtual]
 

Reimplemented from Aggregating.

Definition at line 20 of file cascade.cpp.

References Aggregating::lm, Cascade::lower_margin, Object::NIL_ID, UNSERIALIZE_PARENT, and Cascade::upper_margin.


Member Data Documentation

std::vector<REAL> lower_margin [protected]
 

Definition at line 50 of file cascade.h.

Referenced by Cascade::operator()(), Cascade::serialize(), and Cascade::unserialize().

std::vector<REAL> upper_margin [protected]
 

Definition at line 49 of file cascade.h.

Referenced by Cascade::operator()(), Cascade::serialize(), and Cascade::unserialize().


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