AdaBoost_ECOC Class Reference

AdaBoost.ECC with exponential cost and Hamming distance. More...

#include <adaboost_ecoc.h>

Inheritance diagram for AdaBoost_ECOC:

Inheritance graph
[legend]
Collaboration diagram for AdaBoost_ECOC:

Collaboration graph
[legend]
List of all members.

Public Types

enum  PARTITION_METHOD {
  RANDOM_HALF, MAX_CUT, MAX_CUT_GREEDY, RANDOM_2,
  MAX_2
}

Public Member Functions

 AdaBoost_ECOC ()
 AdaBoost_ECOC (const MultiClass_ECOC &s)
 AdaBoost_ECOC (std::istream &is)
virtual const id_tid () const
virtual AdaBoost_ECOCcreate () const
 Create a new object using the default constructor.
virtual AdaBoost_ECOCclone () const
 Create a new object by replicating itself.
void set_partition_method (PARTITION_METHOD m)

Protected Member Functions

pDataWgt smpwgt_with_partition (const ECOC_VECTOR &) const
pLearnModel train_with_full_partition (const ECOC_VECTOR &) const
virtual void setup_aux ()
 Prepare auxiliary variables for current n_in_agg.
virtual bool ECOC_partition (UINT, ECOC_VECTOR &) const
virtual pLearnModel train_with_partition (ECOC_VECTOR &) const
virtual REAL assign_weight (const ECOC_VECTOR &, const LearnModel &) const
virtual void update_aux (const ECOC_VECTOR &)
 Update those auxiliary variables after this round of learning.
std::vector< std::vector<
REAL > > 
confusion_matrix () const
ECOC_VECTOR max_cut (UINT) const
 test all combinations to find out the max-cut
ECOC_VECTOR max_cut_greedy (UINT) const
 nr (or nr+1) is the maximal # of classes that can be "colored"
ECOC_VECTOR random_half (UINT) const

Protected Attributes

PARTITION_METHOD par_method
JointWgt joint_wgt
std::vector< bool > cur_err
pDataWgt cur_smpwgt
 set up by train_with_partition(); used by assign_weight().

Detailed Description

AdaBoost.ECC with exponential cost and Hamming distance.

Definition at line 21 of file adaboost_ecoc.h.


Member Enumeration Documentation

enum PARTITION_METHOD
 

Enumerator:
RANDOM_HALF 
MAX_CUT 
MAX_CUT_GREEDY 
RANDOM_2 
MAX_2 

Definition at line 23 of file adaboost_ecoc.h.


Constructor & Destructor Documentation

AdaBoost_ECOC  )  [inline]
 

Definition at line 34 of file adaboost_ecoc.h.

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

AdaBoost_ECOC const MultiClass_ECOC s  )  [inline]
 

Definition at line 35 of file adaboost_ecoc.h.

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

Definition at line 37 of file adaboost_ecoc.h.


Member Function Documentation

REAL assign_weight const ECOC_VECTOR ,
const LearnModel
const [protected, virtual]
 

Reimplemented from MultiClass_ECOC.

Definition at line 219 of file adaboost_ecoc.cpp.

References AdaBoost_ECOC::cur_err, and AdaBoost_ECOC::cur_smpwgt.

virtual AdaBoost_ECOC* 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

Reimplemented from MultiClass_ECOC.

Reimplemented in AdaBoost_ERP.

Definition at line 41 of file adaboost_ecoc.h.

References AdaBoost_ECOC::AdaBoost_ECOC().

WMAT confusion_matrix  )  const [protected]
 

Definition at line 59 of file adaboost_ecoc.cpp.

References MultiClass_ECOC::ex_class, AdaBoost_ECOC::joint_wgt, LearnModel::n_samples, and MultiClass_ECOC::nclass.

Referenced by AdaBoost_ECOC::max_cut(), and AdaBoost_ECOC::max_cut_greedy().

virtual AdaBoost_ECOC* create  )  const [inline, virtual]
 

Create a new object using the default constructor.

The code for a derived class Derived is always

 return new Derived(); 

Reimplemented from MultiClass_ECOC.

Reimplemented in AdaBoost_ERP.

Definition at line 40 of file adaboost_ecoc.h.

References AdaBoost_ECOC::AdaBoost_ECOC().

bool ECOC_partition UINT  ,
ECOC_VECTOR
const [protected, virtual]
 

Reimplemented from MultiClass_ECOC.

Reimplemented in AdaBoost_ERP.

Definition at line 151 of file adaboost_ecoc.cpp.

References MultiClass_ECOC::ECOC_partition(), AdaBoost_ECOC::max_cut(), AdaBoost_ECOC::MAX_CUT, AdaBoost_ECOC::max_cut_greedy(), AdaBoost_ECOC::MAX_CUT_GREEDY, MultiClass_ECOC::n_class(), AdaBoost_ECOC::par_method, AdaBoost_ECOC::random_half(), and AdaBoost_ECOC::RANDOM_HALF.

Referenced by AdaBoost_ERP::ECOC_partition().

virtual const id_t& id  )  const [virtual]
 

Returns:
Class ID string (class name)

Reimplemented from MultiClass_ECOC.

Reimplemented in AdaBoost_ERP.

ECOC_VECTOR max_cut UINT   )  const [protected]
 

test all combinations to find out the max-cut

Definition at line 73 of file adaboost_ecoc.cpp.

References AdaBoost_ECOC::confusion_matrix(), and gray_next().

Referenced by AdaBoost_ECOC::ECOC_partition().

ECOC_VECTOR max_cut_greedy UINT   )  const [protected]
 

nr (or nr+1) is the maximal # of classes that can be "colored"

Definition at line 101 of file adaboost_ecoc.cpp.

References AdaBoost_ECOC::confusion_matrix().

Referenced by AdaBoost_ERP::ECOC_partition(), and AdaBoost_ECOC::ECOC_partition().

ECOC_VECTOR random_half UINT   )  const [protected]
 

Definition at line 135 of file adaboost_ecoc.cpp.

Referenced by AdaBoost_ERP::ECOC_partition(), and AdaBoost_ECOC::ECOC_partition().

void set_partition_method PARTITION_METHOD  m  )  [inline]
 

Definition at line 44 of file adaboost_ecoc.h.

References AdaBoost_ECOC::par_method.

void setup_aux  )  [protected, virtual]
 

Prepare auxiliary variables for current n_in_agg.

Reimplemented from MultiClass_ECOC.

Definition at line 18 of file adaboost_ecoc.cpp.

References AdaBoost_ECOC::cur_err, MultiClass_ECOC::distances(), MultiClass_ECOC::ex_class, AdaBoost_ECOC::joint_wgt, MultiClass_ECOC::n_class(), Aggregating::n_in_agg, LearnModel::n_samples, MultiClass_ECOC::nclass, and LearnModel::ptw.

pDataWgt smpwgt_with_partition const ECOC_VECTOR  )  const [protected]
 

Definition at line 175 of file adaboost_ecoc.cpp.

References MultiClass_ECOC::ex_class, MultiClass_ECOC::is_full_partition(), AdaBoost_ECOC::joint_wgt, MultiClass_ECOC::n_class(), and LearnModel::n_samples.

Referenced by AdaBoost_ECOC::train_with_full_partition().

pLearnModel train_with_full_partition const ECOC_VECTOR  )  const [protected]
 

Definition at line 194 of file adaboost_ecoc.cpp.

References dataset::append(), AdaBoost_ECOC::cur_smpwgt, MultiClass_ECOC::ex_class, Aggregating::lm_base, LearnModel::ptd, LearnModel::set_train_data(), AdaBoost_ECOC::smpwgt_with_partition(), and LearnModel::train().

Referenced by AdaBoost_ERP::train_with_partition(), and AdaBoost_ECOC::train_with_partition().

pLearnModel train_with_partition ECOC_VECTOR  )  const [protected, virtual]
 

Reimplemented from MultiClass_ECOC.

Reimplemented in AdaBoost_ERP.

Definition at line 208 of file adaboost_ecoc.cpp.

References AdaBoost_ECOC::cur_err, MultiClass_ECOC::ex_class, MultiClass_ECOC::is_full_partition(), LearnModel::ptd, LearnModel::ptw, and AdaBoost_ECOC::train_with_full_partition().

void update_aux const ECOC_VECTOR p  )  [protected, virtual]
 

Update those auxiliary variables after this round of learning.

Reimplemented from MultiClass_ECOC.

Definition at line 236 of file adaboost_ecoc.cpp.

References AdaBoost_ECOC::cur_err, MultiClass_ECOC::ex_class, MultiClass_ECOC::is_full_partition(), AdaBoost_ECOC::joint_wgt, MultiClass_ECOC::lm_wgt, and Aggregating::n_in_agg.


Member Data Documentation

std::vector<bool> cur_err [mutable, protected]
 

set up by train_with_partition(); used by assign_weight() and update_aux().

Definition at line 52 of file adaboost_ecoc.h.

Referenced by AdaBoost_ECOC::assign_weight(), AdaBoost_ECOC::setup_aux(), AdaBoost_ERP::train_with_partition(), AdaBoost_ECOC::train_with_partition(), and AdaBoost_ECOC::update_aux().

pDataWgt cur_smpwgt [mutable, protected]
 

set up by train_with_partition(); used by assign_weight().

Definition at line 54 of file adaboost_ecoc.h.

Referenced by AdaBoost_ECOC::assign_weight(), and AdaBoost_ECOC::train_with_full_partition().

JointWgt joint_wgt [protected]
 

set up by setup_aux(); updated by update_aux(); used by a lot of functions here.

Definition at line 49 of file adaboost_ecoc.h.

Referenced by AdaBoost_ECOC::confusion_matrix(), AdaBoost_ECOC::setup_aux(), AdaBoost_ECOC::smpwgt_with_partition(), AdaBoost_ERP::train_with_partial_partition(), AdaBoost_ERP::train_with_partition(), and AdaBoost_ECOC::update_aux().

PARTITION_METHOD par_method [protected]
 

Definition at line 31 of file adaboost_ecoc.h.

Referenced by AdaBoost_ERP::ECOC_partition(), AdaBoost_ECOC::ECOC_partition(), and AdaBoost_ECOC::set_partition_method().


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