#include <multiclass_ecoc.h>
Inheritance diagram for MultiClass_ECOC:
Public Member Functions | |
MultiClass_ECOC () | |
MultiClass_ECOC (std::istream &is) | |
virtual const id_t & | id () const |
virtual MultiClass_ECOC * | create () const |
Create a new object using the default constructor. | |
virtual MultiClass_ECOC * | clone () const |
Create a new object by replicating itself. | |
REAL | model_weight (UINT n) const |
const ECOC_TABLE & | ECOC_table () const |
void | set_ECOC_table (const ECOC_TABLE &) |
void | set_ECOC_table (ECOC_TYPE) |
void | set_ECOC_table (UINT, const ECOC_VECTOR &) |
UINT | n_class () const |
virtual bool | support_weighted_data () const |
Whether the learning model/algorithm supports unequally weighted data. | |
virtual REAL | c_error (const Output &out, const Output &y) const |
Error measure for classification problems. | |
virtual void | set_train_data (const pDataSet &, const pDataWgt &=0) |
Set the data set and sample weight to be used in training. | |
virtual void | train () |
Train with preset data set and sample weight. | |
virtual void | reset () |
virtual Output | operator() (const Input &) const |
virtual Output | get_output (UINT idx) const |
Get the output of the hypothesis on the idx-th input. | |
virtual REAL | margin (UINT) const |
Report the (unnormalized) margin of the example i. | |
virtual REAL | margin_of (const Input &, const Output &) const |
Report the (unnormalized) margin of an example (x, y). | |
REAL | cost () const |
The in-sample exponential cost defined in my paper. | |
Protected Member Functions | |
virtual REAL | ECOC_distance (const Output &, const ECOC_VECTOR &) const |
virtual REAL | ECOC_distance (REAL, int, REAL, REAL=0) const |
const std::vector< REAL > & | distances (const Input &) const |
const std::vector< REAL > & | distances (UINT) const |
bool | is_full_partition (const ECOC_VECTOR &) const |
Does the partition only consist of -1 and +1? | |
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. | |
virtual bool | serialize (std::ostream &, ver_list &) const |
virtual bool | unserialize (std::istream &, ver_list &, const id_t &=NIL_ID) |
Protected Attributes | |
std::vector< REAL > | lm_wgt |
hypothesis weight | |
ECOC_TABLE | ecoc |
ECOC_TYPE | ecoc_type |
UINT | nclass |
number of classes | |
std::vector< REAL > | labels |
class labels | |
std::vector< UINT > | ex_class |
class number of examples | |
std::vector< REAL > | local_d |
Definition at line 30 of file multiclass_ecoc.h.
|
Definition at line 44 of file multiclass_ecoc.h. References LearnModel::set_dimensions(). Referenced by MultiClass_ECOC::clone(), and MultiClass_ECOC::create(). |
|
Definition at line 46 of file multiclass_ecoc.h. |
|
Reimplemented in AdaBoost_ECOC. Definition at line 121 of file multiclass_ecoc.h. Referenced by MultiClass_ECOC::train(). |
|
Error measure for classification problems.
Reimplemented from LearnModel. Definition at line 124 of file multiclass_ecoc.cpp. References LABEL_EQUAL, and LearnModel::n_output(). |
|
Create a new object by replicating itself.
return new Derived(*this);
Implements Aggregating. Reimplemented in AdaBoost_ECOC, and AdaBoost_ERP. Definition at line 51 of file multiclass_ecoc.h. References MultiClass_ECOC::MultiClass_ECOC(). |
|
The in-sample exponential cost defined in my paper.
Definition at line 399 of file multiclass_ecoc.cpp. References MultiClass_ECOC::distances(), MultiClass_ECOC::ex_class, LearnModel::ptd, and LearnModel::ptw. |
|
Create a new object using the default constructor. The code for a derived class Derived is always return new Derived(); Implements Aggregating. Reimplemented in AdaBoost_ECOC, and AdaBoost_ERP. Definition at line 50 of file multiclass_ecoc.h. References MultiClass_ECOC::MultiClass_ECOC(). |
|
Definition at line 263 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc, MultiClass_ECOC::ECOC_distance(), MultiClass_ECOC::get_output(), Aggregating::lm, MultiClass_ECOC::lm_wgt, and Aggregating::n_in_agg. |
|
Definition at line 243 of file multiclass_ecoc.cpp. References Aggregating::lm, MultiClass_ECOC::lm_wgt, Aggregating::n_in_agg, and LearnModel::n_output(). Referenced by MultiClass_ECOC::cost(), MultiClass_ECOC::get_output(), MultiClass_ECOC::margin(), MultiClass_ECOC::margin_of(), MultiClass_ECOC::operator()(), and AdaBoost_ECOC::setup_aux(). |
|
Definition at line 348 of file multiclass_ecoc.cpp. |
|
Definition at line 337 of file multiclass_ecoc.cpp. References MultiClass_ECOC::lm_wgt. Referenced by MultiClass_ECOC::distances(). |
|
Reimplemented in AdaBoost_ECOC, and AdaBoost_ERP. Definition at line 360 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc, and Aggregating::size(). Referenced by AdaBoost_ERP::ECOC_partition(), AdaBoost_ECOC::ECOC_partition(), and MultiClass_ECOC::train(). |
|
Definition at line 55 of file multiclass_ecoc.h. References MultiClass_ECOC::ecoc. |
|
Get the output of the hypothesis on the idx-th input.
Reimplemented from LearnModel. Definition at line 307 of file multiclass_ecoc.cpp. References MultiClass_ECOC::distances(), MultiClass_ECOC::ecoc, GET_BEST_CLASS, MultiClass_ECOC::labels, and LearnModel::ptw. Referenced by MultiClass_ECOC::distances(). |
|
Implements Object. Reimplemented in AdaBoost_ECOC, and AdaBoost_ERP. Referenced by MultiClass_ECOC::train(). |
|
Does the partition only consist of -1 and +1?
Definition at line 353 of file multiclass_ecoc.cpp. Referenced by AdaBoost_ECOC::smpwgt_with_partition(), AdaBoost_ERP::train_with_partition(), AdaBoost_ECOC::train_with_partition(), and AdaBoost_ECOC::update_aux(). |
|
Report the (unnormalized) margin of the example i.
Reimplemented from LearnModel. Definition at line 328 of file multiclass_ecoc.cpp. References MultiClass_ECOC::distances(), MultiClass_ECOC::ex_class, GET_MARGIN, and LearnModel::ptw. |
|
Report the (unnormalized) margin of an example (x, y).
Reimplemented from LearnModel. Definition at line 320 of file multiclass_ecoc.cpp. References MultiClass_ECOC::distances(), GET_MARGIN, LABEL2INDEX, LABEL_EQUAL, and MultiClass_ECOC::labels. |
|
Definition at line 54 of file multiclass_ecoc.h. References MultiClass_ECOC::lm_wgt. |
|
Definition at line 59 of file multiclass_ecoc.h. References MultiClass_ECOC::nclass. Referenced by AdaBoost_ECOC::ECOC_partition(), AdaBoost_ECOC::setup_aux(), and AdaBoost_ECOC::smpwgt_with_partition(). |
|
Implements LearnModel. Definition at line 301 of file multiclass_ecoc.cpp. References MultiClass_ECOC::distances(), GET_BEST_CLASS, and MultiClass_ECOC::labels. |
|
Reimplemented from Aggregating. Definition at line 129 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc, MultiClass_ECOC::ecoc_type, MultiClass_ECOC::lm_wgt, lemga::NO_TYPE, and Aggregating::reset(). |
|
Reimplemented from Aggregating. Definition at line 20 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc, Aggregating::lm, MultiClass_ECOC::lm_wgt, SERIALIZE_PARENT, and Aggregating::size(). |
|
Definition at line 79 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc, and Aggregating::size(). |
|
Definition at line 89 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc_type, lemga::NO_TYPE, lemga::ONE_VS_ALL, and lemga::ONE_VS_ONE. |
|
Definition at line 72 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc, Aggregating::max_n_model, Aggregating::set_max_models(), and Aggregating::size(). Referenced by MultiClass_ECOC::train(). |
|
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 Aggregating. Definition at line 139 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc_type, LABEL_EQUAL, MultiClass_ECOC::labels, LearnModel::n_samples, lemga::NO_TYPE, LearnModel::ptd, and Aggregating::set_train_data(). |
|
Prepare auxiliary variables for current n_in_agg.
Reimplemented in AdaBoost_ECOC. Definition at line 118 of file multiclass_ecoc.h. Referenced by MultiClass_ECOC::train(). |
|
Whether the learning model/algorithm supports unequally weighted data.
Reimplemented from LearnModel. Definition at line 61 of file multiclass_ecoc.h. |
|
Train with preset data set and sample weight.
Implements LearnModel. Definition at line 194 of file multiclass_ecoc.cpp. References LearnModel::_n_out, MultiClass_ECOC::assign_weight(), MultiClass_ECOC::ecoc, MultiClass_ECOC::ECOC_partition(), MultiClass_ECOC::id(), MultiClass_ECOC::labels, Aggregating::lm, Aggregating::lm_base, MultiClass_ECOC::lm_wgt, Aggregating::max_n_model, Aggregating::n_in_agg, LearnModel::ptd, LearnModel::ptw, LearnModel::set_dimensions(), MultiClass_ECOC::set_ECOC_table(), MultiClass_ECOC::setup_aux(), MultiClass_ECOC::train_with_partition(), and MultiClass_ECOC::update_aux(). |
|
Reimplemented in AdaBoost_ECOC, and AdaBoost_ERP. Definition at line 370 of file multiclass_ecoc.cpp. References dataset::append(), MultiClass_ECOC::ex_class, Aggregating::lm_base, LearnModel::ptd, and LearnModel::ptw. Referenced by MultiClass_ECOC::train(). |
|
Reimplemented from Aggregating. Definition at line 46 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc, Aggregating::lm, MultiClass_ECOC::lm_wgt, Object::NIL_ID, and UNSERIALIZE_PARENT. |
|
Update those auxiliary variables after this round of learning.
Reimplemented in AdaBoost_ECOC. Definition at line 124 of file multiclass_ecoc.h. Referenced by MultiClass_ECOC::train(). |
|
the ECC table Definition at line 33 of file multiclass_ecoc.h. Referenced by MultiClass_ECOC::distances(), MultiClass_ECOC::ECOC_partition(), MultiClass_ECOC::ECOC_table(), MultiClass_ECOC::get_output(), MultiClass_ECOC::reset(), MultiClass_ECOC::serialize(), MultiClass_ECOC::set_ECOC_table(), MultiClass_ECOC::train(), and MultiClass_ECOC::unserialize(). |
|
The type of the ECOC table, if there is some fixed type.
Definition at line 36 of file multiclass_ecoc.h. Referenced by MultiClass_ECOC::reset(), MultiClass_ECOC::set_ECOC_table(), and MultiClass_ECOC::set_train_data(). |
|
|
class labels
Definition at line 40 of file multiclass_ecoc.h. Referenced by MultiClass_ECOC::get_output(), MultiClass_ECOC::margin_of(), MultiClass_ECOC::operator()(), MultiClass_ECOC::set_train_data(), and MultiClass_ECOC::train(). |
|
hypothesis weight
Definition at line 32 of file multiclass_ecoc.h. Referenced by MultiClass_ECOC::distances(), MultiClass_ECOC::ECOC_distance(), MultiClass_ECOC::model_weight(), MultiClass_ECOC::reset(), MultiClass_ECOC::serialize(), MultiClass_ECOC::train(), MultiClass_ECOC::unserialize(), and AdaBoost_ECOC::update_aux(). |
|
Definition at line 108 of file multiclass_ecoc.h. |
|
number of classes
Definition at line 39 of file multiclass_ecoc.h. Referenced by AdaBoost_ECOC::confusion_matrix(), MultiClass_ECOC::n_class(), AdaBoost_ECOC::setup_aux(), AdaBoost_ERP::train_with_partial_partition(), and AdaBoost_ERP::train_with_partition(). |