#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 | initialize () |
Initialize the model for training. | |
virtual void | set_train_data (const pDataSet &, const pDataWgt &=0) |
Set the data set and sample weight to be used in training. | |
virtual REAL | train () |
Train with preset data set and sample weight. | |
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 |
virtual void | reset_training () |
Prepare auxiliary variables for current n_in_agg. | |
virtual bool | ECOC_partition (UINT, ECOC_VECTOR &) |
virtual pLearnModel | train_with_partition (ECOC_VECTOR &) |
virtual REAL | assign_weight (const ECOC_VECTOR &, const LearnModel &) |
virtual void | update_training (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 &=empty_id) |
Protected Attributes | |
std::vector< REAL > | lm_wgt |
hypothesis weight | |
ECOC_TABLE | ecoc |
the ECC table | |
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 29 of file multiclass_ecoc.h.
|
Definition at line 40 of file multiclass_ecoc.h. Referenced by MultiClass_ECOC::clone(), and MultiClass_ECOC::create(). |
|
Definition at line 41 of file multiclass_ecoc.h. |
|
Reimplemented in AdaBoost_ECOC. Definition at line 379 of file multiclass_ecoc.cpp. Referenced by MultiClass_ECOC::train(). |
|
Error measure for classification problems.
Reimplemented from LearnModel. Definition at line 120 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. Definition at line 45 of file multiclass_ecoc.h. References MultiClass_ECOC::MultiClass_ECOC(). |
|
The in-sample exponential cost defined in my paper.
Definition at line 383 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. Definition at line 44 of file multiclass_ecoc.h. References MultiClass_ECOC::MultiClass_ECOC(). |
|
Definition at line 250 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 230 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(), and MultiClass_ECOC::operator()(). |
|
Definition at line 335 of file multiclass_ecoc.cpp. |
|
Definition at line 324 of file multiclass_ecoc.cpp. References MultiClass_ECOC::lm_wgt. Referenced by MultiClass_ECOC::distances(). |
|
Reimplemented in AdaBoost_ECOC. Definition at line 340 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc, and Aggregating::size(). Referenced by AdaBoost_ECOC::ECOC_partition(), and MultiClass_ECOC::train(). |
|
Definition at line 49 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 294 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. Referenced by MultiClass_ECOC::train(). |
|
Initialize the model for training.
Reimplemented from Aggregating. Definition at line 125 of file multiclass_ecoc.cpp. References Aggregating::initialize(), and MultiClass_ECOC::lm_wgt. |
|
Report the (unnormalized) margin of the example i.
Reimplemented from LearnModel. Definition at line 315 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 307 of file multiclass_ecoc.cpp. References MultiClass_ECOC::distances(), GET_MARGIN, LABEL2INDEX, LABEL_EQUAL, and MultiClass_ECOC::labels. |
|
Definition at line 48 of file multiclass_ecoc.h. References MultiClass_ECOC::lm_wgt. |
|
Definition at line 53 of file multiclass_ecoc.h. References MultiClass_ECOC::nclass. Referenced by AdaBoost_ECOC::ECOC_partition(), AdaBoost_ECOC::reset_training(), AdaBoost_ECOC::smpwgt_with_partition(), and AdaBoost_ECOC::update_training(). |
|
Implements LearnModel. Definition at line 288 of file multiclass_ecoc.cpp. References MultiClass_ECOC::distances(), GET_BEST_CLASS, and MultiClass_ECOC::labels. |
|
Prepare auxiliary variables for current n_in_agg.
Reimplemented in AdaBoost_ECOC. Definition at line 109 of file multiclass_ecoc.h. Referenced by MultiClass_ECOC::train(). |
|
Reimplemented from Aggregating. Definition at line 19 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc, Aggregating::lm, MultiClass_ECOC::lm_wgt, SERIALIZE_PARENT, and Aggregating::size(). |
|
Definition at line 80 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc, and Aggregating::size(). |
|
Definition at line 90 of file multiclass_ecoc.cpp. References lemga::ONE_VS_ALL, and lemga::ONE_VS_ONE. |
|
Definition at line 71 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc, Aggregating::max_n_model, and Aggregating::set_max_models(). 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 133 of file multiclass_ecoc.cpp. References LABEL_EQUAL, MultiClass_ECOC::labels, Aggregating::lm_base, LearnModel::n_output(), LearnModel::n_samples, LearnModel::ptd, and Aggregating::set_train_data(). |
|
Whether the learning model/algorithm supports unequally weighted data.
Reimplemented from LearnModel. Definition at line 55 of file multiclass_ecoc.h. |
|
Train with preset data set and sample weight.
Implements LearnModel. Definition at line 180 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, MultiClass_ECOC::reset_training(), MultiClass_ECOC::set_ECOC_table(), MultiClass_ECOC::train_with_partition(), and MultiClass_ECOC::update_training(). |
|
Reimplemented in AdaBoost_ECOC. Definition at line 350 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 44 of file multiclass_ecoc.cpp. References MultiClass_ECOC::ecoc, Object::empty_id, Aggregating::lm, MultiClass_ECOC::lm_wgt, and UNSERIALIZE_PARENT. |
|
Update those auxiliary variables after this round of learning.
Reimplemented in AdaBoost_ECOC. Definition at line 114 of file multiclass_ecoc.h. Referenced by MultiClass_ECOC::train(). |
|
the ECC table
Definition at line 32 of file multiclass_ecoc.h. Referenced by MultiClass_ECOC::distances(), MultiClass_ECOC::ECOC_partition(), MultiClass_ECOC::ECOC_table(), MultiClass_ECOC::get_output(), MultiClass_ECOC::serialize(), MultiClass_ECOC::set_ECOC_table(), MultiClass_ECOC::train(), and MultiClass_ECOC::unserialize(). |
|
class number of examples
Definition at line 37 of file multiclass_ecoc.h. Referenced by AdaBoost_ECOC::confusion_matrix(), MultiClass_ECOC::cost(), MultiClass_ECOC::margin(), AdaBoost_ECOC::reset_training(), AdaBoost_ECOC::smpwgt_with_partition(), MultiClass_ECOC::train_with_partition(), AdaBoost_ECOC::train_with_partition(), and AdaBoost_ECOC::update_training(). |
|
class labels
Definition at line 36 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 31 of file multiclass_ecoc.h. Referenced by MultiClass_ECOC::distances(), MultiClass_ECOC::ECOC_distance(), MultiClass_ECOC::initialize(), MultiClass_ECOC::model_weight(), MultiClass_ECOC::serialize(), MultiClass_ECOC::train(), MultiClass_ECOC::unserialize(), and AdaBoost_ECOC::update_training(). |
|
Definition at line 102 of file multiclass_ecoc.h. |
|
number of classes
Definition at line 35 of file multiclass_ecoc.h. Referenced by AdaBoost_ECOC::confusion_matrix(), and MultiClass_ECOC::n_class(). |