ECOCPAK v0.9
Functions
Fn_subclass_encoding

Functions

Classifierecocpak::create_classifier (const ClassData &A, const ClassData &B, const u32 classifiers_option, double &training_error)
Classifierecocpak::create_classifier (const ClassData &A, const ClassData &B, const u32 classifiers_option)
Classifierecocpak::create_classifier (const mat &A, const mat &B, const u32 classifiers_option)
void ecocpak::coding_matrix_update (imat &coding_matrix, const vector< ClassData > &class_vector, vector< ClassData > &split_classes_vector, u32 indx)
void ecocpak::update_class_tracker (vector< colvec > &class_tracker, const vector< ClassData > &class_vector, const u32 indx, vector< ClassData > &split_classes_vector, vector< ClassData > &classes_created_vector)
bool ecocpak::save_classifier (Classifier *c, const vector< ClassData > &class_vector, const ucolvec &best_set_indices, const ucolvec &complement_set_indices, vector< Classifier * > &classifiers_vector)
bool ecocpak::save_classifier (Classifier *c, const vector< ClassData > &class_vector, vector< Classifier * > &classifiers_vector)
bool ecocpak::contain_same_classes (const ucolvec &A, const vector< ClassData > &B)
void ecocpak::direct_subclass_encoding (const vector< ClassData > &class_vector, const Threshold &thres, const int criterion_option, const int classifiers_option, imat &coding_matrix, vector< Classifier * > &classifiers_vector, vector< ClassData > &classes_created_vector, vector< colvec > &class_tracker, vector< ucolvec > &problem_tracker)
void ecocpak::subclass_encoding (const mat &samples, const icolvec &labels, const Threshold &thres, const int criterion_option, const int classifiers_option, imat &coding_matrix, vector< Classifier * > &classifiers_vector, vector< ClassData > &classes_created_vector)
void ecocpak::direct_decoc_encoding (const vector< ClassData > &class_vector, const int criterion_option, const int classifiers_option, vector< Classifier * > &classifiers_vector)
void ecocpak::decoc_coding (const vector< ClassData > &class_vector, const int criterion_option, const int classifiers_option, imat &coding_matrix, vector< Classifier * > &classifiers_vector)
Classifiercreate_classifier (const ClassData &A, const ClassData &B, const u32 classifiers_option, double &training_error)
Classifiercreate_classifier (const ClassData &A, const ClassData &B, const u32 classifiers_option)
void coding_matrix_update (imat &coding_matrix, const vector< ClassData > &class_vector, vector< ClassData > &split_classes_vector, u32 indx)
void update_class_tracker (vector< colvec > &class_tracker, const vector< ClassData > &class_vector, const u32 indx, vector< ClassData > &split_classes_vector, vector< ClassData > &classes_created_vector)
bool save_classifier (Classifier *c, const vector< ClassData > &class_vector, const ucolvec &best_set_indices, const ucolvec &complement_set_indices, vector< Classifier * > &classifiers_vector)
bool save_classifier (Classifier *c, const vector< ClassData > &class_vector, vector< Classifier * > &classifiers_vector)
bool contain_same_classes (const ucolvec &A, const vector< ClassData > &B)
void direct_subclass_encoding (const vector< ClassData > &class_vector, const Threshold &thres, const int criterion_option, const int classifiers_option, imat &coding_matrix, vector< Classifier * > &classifiers_vector, vector< ClassData > &classes_created_vector, vector< colvec > &class_tracker, vector< ucolvec > &problem_tracker)
void subclass_encoding (const mat &samples, const icolvec &labels, const Threshold &thres, const int criterion_option, const int classifiers_option, imat &coding_matrix, vector< Classifier * > &classifiers_vector, vector< ClassData > &classes_created_vector)
void direct_decoc_encoding (const vector< ClassData > &class_vector, const int criterion_option, const int classifiers_option, vector< Classifier * > &classifiers_vector)
void decoc_coding (const vector< ClassData > &class_vector, const int criterion_option, const int classifiers_option, imat &coding_matrix, vector< Classifier * > &classifiers_vector)

Function Documentation

void ecocpak::coding_matrix_update ( imat &  coding_matrix,
const vector< ClassData > &  class_vector,
vector< ClassData > &  split_classes_vector,
u32  indx 
)
  • Updates the coding matrix.
  • Input Arguments:
    • coding_matrix : Coding matrix.
    • class_vector : Vector of initial classes.
  • Output Arguments:
    • split_classes_vector : Vector of new classes.
    • indx : Index of update 0, 1, complement_set_indices[0] or best_set_indices[0].
  • Return Argument:
    • Void.
void coding_matrix_update ( imat &  coding_matrix,
const vector< ClassData > &  class_vector,
vector< ClassData > &  split_classes_vector,
u32  indx 
)
  • Updates the coding matrix.
  • Input Arguments:
    • coding_matrix : Coding matrix.
    • class_vector : Vector of initial classes.
  • Output Arguments:
    • split_classes_vector : Vector of new classes.
    • indx : Index of update 0, 1, complement_set_indices[0] or best_set_indices[0].
  • Return Argument:
    • Void.
bool ecocpak::contain_same_classes ( const ucolvec &  A,
const vector< ClassData > &  B 
)
  • Checks whether first input argument vector's elements correspond to classes indices inside second input argument class vector.
  • Input Arguments:
    • A : Vector of indices.
    • B : Vector of classes.
  • Output Arguments:
    • Void.
  • Return Argument:
    • Boolean which is true if first input vector elements equals the class indices in second input argument class vector, false otherwise.
bool contain_same_classes ( const ucolvec &  A,
const vector< ClassData > &  B 
)
  • Checks whether first input argument vector's elements correspond to classes indices inside second input argument class vector.
  • Input Arguments:
    • A : Vector of indices.
    • B : Vector of classes.
  • Output Arguments:
    • Void.
  • Return Argument:
    • Boolean which is true if first input vector elements equals the class indices in second input argument class vector, false otherwise.
Classifier* ecocpak::create_classifier ( const ClassData A,
const ClassData B,
const u32  classifiers_option 
)
  • Constructs a classifier for a specific problem.
  • Function is overloaded.
  • Input Arguments:
    • A : Feature vectors of class A.
    • B : Feature vectors of class B.
    • classifiers_option : Type of classifier.
  • Output Arguments:
    • Void.
  • Return Argument:
Classifier* ecocpak::create_classifier ( const ClassData A,
const ClassData B,
const u32  classifiers_option,
double &  training_error 
)
  • Constructs a classifier for a specific problem.
  • Function is overloaded.
  • Input Arguments:
    • A : Feature vectors of class A.
    • B : Feature vectors of class B.
    • classifiers_option : Type of classifier.
  • Output Arguments:
    • training_error : Training error.
Classifier* create_classifier ( const ClassData A,
const ClassData B,
const u32  classifiers_option,
double &  training_error 
)
  • Constructs a classifier for a specific problem.
  • Function is overloaded.
  • Input Arguments:
    • A : Feature vectors of class A.
    • B : Feature vectors of class B.
    • classifiers_option : Type of classifier.
  • Output Arguments:
    • training_error : Training error.
Classifier* ecocpak::create_classifier ( const mat &  A,
const mat &  B,
const u32  classifiers_option 
)
  • Constructs a classifier for a specific problem.
  • Function is overloaded.
  • Input Arguments:
    • A : Datamatrix of class A.
    • B : Datamatrix of class B.
    • classifiers_option : Type of classifier.
  • Output Arguments:
    • Void.
  • Return Argument:
Classifier* create_classifier ( const ClassData A,
const ClassData B,
const u32  classifiers_option 
)
  • Constructs a classifier for a specific problem.
  • Function is overloaded.
  • Input Arguments:
    • A : Feature vectors of class A.
    • B : Feature vectors of class B.
    • classifiers_option : Type of classifier.
  • Output Arguments:
    • Void.
  • Return Argument:
void decoc_coding ( const vector< ClassData > &  class_vector,
const int  criterion_option,
const int  classifiers_option,
imat &  coding_matrix,
vector< Classifier * > &  classifiers_vector 
)
  • Constructs the coding matrix for the DECOC procedure.
  • Function enconding is actually the interface of the direct_subclass_encoding recursive procedure.
  • Input Arguments:
    • samples : A 2D matrix where each one of its rows represents a sample vector.
    • criterion_option : criterion_optionerion option (e.g., fqmi, fldr e.t.c).
    • classifiers_option : Type of classifier.
  • Output Arguments:
    • coding_matrix : Coding matrix.
  • Return Argument:
    • Void.
void ecocpak::decoc_coding ( const vector< ClassData > &  class_vector,
const int  criterion_option,
const int  classifiers_option,
imat &  coding_matrix,
vector< Classifier * > &  classifiers_vector 
)
  • Constructs the coding matrix for the DECOC procedure.
  • Function enconding is actually the interface of the direct_subclass_encoding recursive procedure.
  • Input Arguments:
    • samples : A 2D matrix where each one of its rows represents a sample vector.
    • criterion_option : criterion_optionerion option (e.g., fqmi, fldr e.t.c).
    • classifiers_option : Type of classifier.
  • Output Arguments:
    • coding_matrix : Coding matrix.
  • Return Argument:
    • Void.
void ecocpak::direct_decoc_encoding ( const vector< ClassData > &  class_vector,
const int  criterion_option,
const int  classifiers_option,
vector< Classifier * > &  classifiers_vector 
)
  • Construct the coding matrix for the sub-ECOC procedure.
  • Function is recursive.
  • Input Arguments:
    • class_vector : Vector which holds the current classes examined.
    • criterion_option : Criterion_option.
    • classifiers_option : Type of classifier.
  • Output Arguments:
    • coding_matrix : Enconding matrix so far.
    • classifiers_vector : Vector which holds the classifiers created so far.
  • Return Argument:
    • Void.
void direct_decoc_encoding ( const vector< ClassData > &  class_vector,
const int  criterion_option,
const int  classifiers_option,
vector< Classifier * > &  classifiers_vector 
)
  • Construct the coding matrix for the sub-ECOC procedure.
  • Function is recursive.
  • Input Arguments:
    • class_vector : Vector which holds the current classes examined.
    • criterion_option : Criterion_option.
    • classifiers_option : Type of classifier.
  • Output Arguments:
    • coding_matrix : Enconding matrix so far.
    • classifiers_vector : Vector which holds the classifiers created so far.
  • Return Argument:
    • Void.
void ecocpak::direct_subclass_encoding ( const vector< ClassData > &  class_vector,
const Threshold thres,
const int  criterion_option,
const int  classifiers_option,
imat &  coding_matrix,
vector< Classifier * > &  classifiers_vector,
vector< ClassData > &  classes_created_vector,
vector< colvec > &  class_tracker,
vector< ucolvec > &  problem_tracker 
)
  • Construct the coding matrix for the sub-ECOC procedure.
  • Function is recursive.
  • Input Arguments:
    • class_vector : Vector which holds the current classes examined.
    • thres : User defined thresholds.
    • criterion_option : Criterion_option.
    • classifiers_option : Type of classifier.
  • Output Arguments:
    • coding_matrix : Enconding matrix so far.
    • classifiers_vector : Vector which holds the classifiers created so far.
    • classes_created_vector : Vector which holds the classes created so far.
    • class_tracker : Vector which stores the problem configurations examined so far.
    • problem_tracker : Vector which tracks the problem configurations examined so far (avoids unnecessary recursion calls).
  • Return Argument:
    • Void.
void direct_subclass_encoding ( const vector< ClassData > &  class_vector,
const Threshold thres,
const int  criterion_option,
const int  classifiers_option,
imat &  coding_matrix,
vector< Classifier * > &  classifiers_vector,
vector< ClassData > &  classes_created_vector,
vector< colvec > &  class_tracker,
vector< ucolvec > &  problem_tracker 
)
  • Construct the coding matrix for the sub-ECOC procedure.
  • Function is recursive.
  • Input Arguments:
    • class_vector : Vector which holds the current classes examined.
    • thres : User defined thresholds.
    • criterion_option : Criterion_option.
    • classifiers_option : Type of classifier.
  • Output Arguments:
    • coding_matrix : Enconding matrix so far.
    • classifiers_vector : Vector which holds the classifiers created so far.
    • classes_created_vector : Vector which holds the classes created so far.
    • class_tracker : Vector which stores the problem configurations examined so far.
    • problem_tracker : Vector which tracks the problem configurations examined so far (avoids unnecessary recursion calls).
  • Return Argument:
    • Void.
bool save_classifier ( Classifier c,
const vector< ClassData > &  class_vector,
const ucolvec &  best_set_indices,
const ucolvec &  complement_set_indices,
vector< Classifier * > &  classifiers_vector 
)
  • Save classifier for many vs many or one vs many problem configuration.
  • Input Arguments:
    • c : Reference to classifier object that is to be saved.
    • class_vector : Vector which holds the current classes examined.
    • best_set_indices : Array which holds the labels of the best set of classes yield by SFFS.
    • complement_set_indices : Array which holds the rest of the labels of the classes.
  • Output Arguments:
    • classifiers_vector : Vector which holds the classifiers created so far.
  • Return Argument:
    • True if classifier is saved, false otherwise.
bool save_classifier ( Classifier c,
const vector< ClassData > &  class_vector,
vector< Classifier * > &  classifiers_vector 
)
  • Save classifier for one vs one problem configuration.
  • Overloaded function.
  • Input Arguments:
    • c : Reference to classifier object that is to be saved.
    • class_vector : Vector which holds the current classes examined (number of classes = 2).
  • Output Arguments:
    • classifiers_vector : Vector which holds the classifiers created so far.
  • Return Argument:
    • True if classifier is saved, false otherwise.
bool ecocpak::save_classifier ( Classifier c,
const vector< ClassData > &  class_vector,
vector< Classifier * > &  classifiers_vector 
)
  • Save classifier for one vs one problem configuration.
  • Overloaded function.
  • Input Arguments:
    • c : Reference to classifier object that is to be saved.
    • class_vector : Vector which holds the current classes examined (number of classes = 2).
  • Output Arguments:
    • classifiers_vector : Vector which holds the classifiers created so far.
  • Return Argument:
    • True if classifier is saved, false otherwise.
bool ecocpak::save_classifier ( Classifier c,
const vector< ClassData > &  class_vector,
const ucolvec &  best_set_indices,
const ucolvec &  complement_set_indices,
vector< Classifier * > &  classifiers_vector 
)
  • Save classifier for many vs many or one vs many problem configuration.
  • Input Arguments:
    • c : Reference to classifier object that is to be saved.
    • class_vector : Vector which holds the current classes examined.
    • best_set_indices : Array which holds the labels of the best set of classes yield by SFFS.
    • complement_set_indices : Array which holds the rest of the labels of the classes.
  • Output Arguments:
    • classifiers_vector : Vector which holds the classifiers created so far.
  • Return Argument:
    • True if classifier is saved, false otherwise.
void subclass_encoding ( const mat &  samples,
const icolvec &  labels,
const Threshold thres,
const int  criterion_option,
const int  classifiers_option,
imat &  coding_matrix,
vector< Classifier * > &  classifiers_vector,
vector< ClassData > &  classes_created_vector 
)
  • Constructs the coding matrix for the DECOC procedure.
  • Function enconding is actually the interface of the direct_subclass_encoding recursive procedure.
  • Input Arguments:
    • samples : A 2D matrix where each one of its rows represents a sample vector.
    • labels : The corresponding class labels of the samples.
    • thres : User defined thresholds (they control the split).
    • criterion_option : criterion_optionerion option (e.g., fqmi, fldr e.t.c).
    • classifiers_option : Type of classifier.
  • Output Arguments:
    • coding_matrix : Coding matrix.
    • classifiers_vector : Vector which holds the resulting classifiers.
    • classes_created_vector : Vector which holds the final classes created.
  • Return Argument:
    • Void.
void ecocpak::subclass_encoding ( const mat &  samples,
const icolvec &  labels,
const Threshold thres,
const int  criterion_option,
const int  classifiers_option,
imat &  coding_matrix,
vector< Classifier * > &  classifiers_vector,
vector< ClassData > &  classes_created_vector 
)
  • Constructs the coding matrix for the DECOC procedure.
  • Function enconding is actually the interface of the direct_subclass_encoding recursive procedure.
  • Input Arguments:
    • samples : A 2D matrix where each one of its rows represents a sample vector.
    • labels : The corresponding class labels of the samples.
    • thres : User defined thresholds (they control the split).
    • criterion_option : criterion_optionerion option (e.g., fqmi, fldr e.t.c).
    • classifiers_option : Type of classifier.
  • Output Arguments:
    • coding_matrix : Coding matrix.
    • classifiers_vector : Vector which holds the resulting classifiers.
    • classes_created_vector : Vector which holds the final classes created.
  • Return Argument:
    • Void.
void ecocpak::update_class_tracker ( vector< colvec > &  class_tracker,
const vector< ClassData > &  class_vector,
const u32  indx,
vector< ClassData > &  split_classes_vector,
vector< ClassData > &  classes_created_vector 
)
  • Update class tracker.
  • Input Arguments:
    • class_tracker : Vector which stores the problem configurations examined so far.
    • class_vector : Vector which holds the current classes examined.
    • indx : Index of update 0,1, complement_set_indices[0] or best_set_indices[0].
  • Output Arguments:
    • split_classes_vector : Vector which holds subclasses created (Number of classes = 2).
    • classes_created_vector : Vector which holds the classes created so far.
  • Return Argument:
    • Void.
void update_class_tracker ( vector< colvec > &  class_tracker,
const vector< ClassData > &  class_vector,
const u32  indx,
vector< ClassData > &  split_classes_vector,
vector< ClassData > &  classes_created_vector 
)
  • Update class tracker.
  • Input Arguments:
    • class_tracker : Vector which stores the problem configurations examined so far.
    • class_vector : Vector which holds the current classes examined.
    • indx : Index of update 0,1, complement_set_indices[0] or best_set_indices[0].
  • Output Arguments:
    • split_classes_vector : Vector which holds subclasses created (Number of classes = 2).
    • classes_created_vector : Vector which holds the classes created so far.
  • Return Argument:
    • Void.
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerator Defines