ECOCPAK v0.9
Data Structures | Namespaces | Defines | Typedefs | Enumerations | Functions | Variables
ecocpak.hpp File Reference
#include "svm.h"
#include "ClassData.hpp"
#include "Classifier.hpp"
#include "Threshold.hpp"
#include "fn_aux.hpp"
#include "fn_loss_weighted_decoding.hpp"
#include "fn_custom_decoding.hpp"
#include "fn_probabilistic_decoding.hpp"
#include "fn_decode_codeword.hpp"
#include "fn_decode.hpp"
#include "fn_dense_to_sparse.hpp"
#include "fn_sparse_to_dense.hpp"
#include "fn_process_labels.hpp"
#include "op_kmeans_proto.hpp"
#include "op_kmeans_meat.hpp"
#include "fn_kmeans.hpp"
#include "Classifier_ncc.hpp"
#include "Classifier_flda.hpp"
#include "Classifier_svm.hpp"
#include "Classifier_adaBoost.hpp"
#include "Classifier_ls.hpp"
#include "Classifier_custom.hpp"
#include "fn_construct_classifier.hpp"
#include "fn_fqmi.hpp"
#include "fn_fldr.hpp"
#include "fn_custom_criterion.hpp"
#include "fn_sffs.hpp"
#include "fn_subclass_encoding.hpp"
#include "fn_one_vs_one.hpp"
#include "fn_one_vs_all.hpp"
#include "fn_decoc.hpp"
#include "fn_subdecoc.hpp"
#include "fn_dense_random_ecoc.hpp"
#include "fn_sparse_random_ecoc.hpp"
#include "fn_ecoc_one.hpp"
#include "fn_forest_ecoc.hpp"
#include "fn_custom_coding.hpp"
#include "fn_group_classes.hpp"
#include "fn_crossvalidation.hpp"
#include "fn_uci_glass.hpp"
#include "fn_uci_iris.hpp"
#include "fn_load_dataset_from_file.hpp"

Go to the source code of this file.

Data Structures

class  ecocpak::ClassData
class  ecocpak::ClassData
class  ecocpak::Classifier
class  ecocpak::Threshold
class  ecocpak::op_kmeans
class  ecocpak::ClassData
class  ecocpak::Classifier
class  ecocpak::Classifier_ncc
class  ecocpak::ClassData
class  ecocpak::Classifier
class  ecocpak::Classifier_flda
class  ecocpak::ClassData
class  ecocpak::Classifier
class  ecocpak::Classifier_svm
class  ecocpak::ClassData
class  ecocpak::Classifier
class  ecocpak::Classifier_weak
class  ecocpak::Classifier_adaBoost
class  ecocpak::ClassData
class  ecocpak::Classifier
class  ecocpak::Classifier_ls
class  ecocpak::ClassData
class  ecocpak::Classifier
class  ecocpak::Classifier_custom

Namespaces

namespace  ecocpak
 

ecocpak namespace


Defines

#define Malloc(type, n)   (type *)malloc( ( n ) * sizeof( type ) )

Typedefs

typedef struct svm_node ** ecocpak::sparse_mat

Enumerations

enum  {
  ecocpak::ONE_VS_ONE, ecocpak::ONE_VS_ALL, ecocpak::DECOC, ecocpak::SUBDECOC,
  ecocpak::DENSE_RANDOM, ecocpak::SPARSE_RANDOM, ecocpak::ECOC_ONE, ecocpak::FOREST_ECOC,
  ecocpak::CUSTOM_CODING
}
enum  {
  ecocpak::HAMMING, ecocpak::EUCLIDEAN, ecocpak::LAPLACIAN, ecocpak::HAMMING_ATTENUATED,
  ecocpak::EUCLIDEAN_ATTENUATED, ecocpak::LINEAR_LOSS_WEIGHTED_DECODING, ecocpak::EXPONENTIAL_LOSS_WEIGHTED_DECODING, ecocpak::LINEAR_LOSS_BASED_DECODING,
  ecocpak::EXPONENTIAL_LOSS_BASED_DECODING, ecocpak::BETA_DENSITY_DECODING, ecocpak::PROBABILISTIC_BASED_DECODING, ecocpak::INVERSE_HAMMING_DECODING,
  ecocpak::CUSTOM_DECODING
}
enum  { ecocpak::FQMI, ecocpak::FLDR, ecocpak::CUSTOM_CRITERION }
enum  { ecocpak::PAIR, ecocpak::ALL_CLASSES }
enum  {
  ecocpak::NCC, ecocpak::FLDA, ecocpak::SVM, ecocpak::ADABOOST,
  ecocpak::LEAST_SQUARES, ecocpak::CUSTOM_CLASSIFIER
}
 enumeration for classifier's type More...
enum  {
  ecocpak::NCC, ecocpak::FLDA, ecocpak::SVM, ecocpak::ADABOOST,
  ecocpak::LEAST_SQUARES, ecocpak::CUSTOM_CLASSIFIER
}
 enumeration for classifier's type More...
enum  {
  ecocpak::NCC, ecocpak::FLDA, ecocpak::SVM, ecocpak::ADABOOST,
  ecocpak::LEAST_SQUARES, ecocpak::CUSTOM_CLASSIFIER
}
 enumeration for classifier's type More...
enum  {
  ecocpak::NCC, ecocpak::FLDA, ecocpak::SVM, ecocpak::ADABOOST,
  ecocpak::LEAST_SQUARES, ecocpak::CUSTOM_CLASSIFIER
}
 enumeration for classifier's type More...
enum  {
  ecocpak::NCC, ecocpak::FLDA, ecocpak::SVM, ecocpak::ADABOOST,
  ecocpak::LEAST_SQUARES, ecocpak::CUSTOM_CLASSIFIER
}
 enumeration for classifier's type More...
enum  {
  ecocpak::NCC, ecocpak::FLDA, ecocpak::SVM, ecocpak::ADABOOST,
  ecocpak::LEAST_SQUARES, ecocpak::CUSTOM_CLASSIFIER
}
 enumeration for classifier's type More...
enum  {
  ecocpak::NCC, ecocpak::FLDA, ecocpak::SVM, ecocpak::ADABOOST,
  ecocpak::LEAST_SQUARES, ecocpak::CUSTOM_CLASSIFIER
}
 enumeration for classifier's type More...

Functions

void print_null (const char *s)
bool ecocpak::contains (const ucolvec &A, const u32 n, const u32 i)
ucolvec ecocpak::complement (const ucolvec &A, const u32 sizeU)
vector< ClassDataecocpak::create_class_vector (const mat &samples, const icolvec &labels)
mat ecocpak::create_samples_matrix (const vector< ClassData > &v)
void ecocpak::create_samples_matrix (const vector< ClassData > &v, mat &samples, icolvec &labels)
void ecocpak::create_samples_matrix (const ClassData &first_class, const ClassData &second_class, mat &samples, icolvec &labels)
void ecocpak::create_samples_matrix (const vector< ClassData > &v, mat &samples, icolvec &labels, ucolvec &n_per_class)
ClassData ecocpak::merge_classes_vector (const vector< ClassData > &v)
ClassData ecocpak::merge_selected_classes (const vector< ClassData > &v, const ucolvec &s)
vector< ClassDataecocpak::split_class (const ClassData &c, const ucolvec &indices, const ucolvec &samples_per_cluster, const int are_valid)
ucolvec ecocpak::complement_sffs (const ucolvec &A, const u32 curSubsetSize)
u32 ecocpak::linear_loss_weighted_decoding (const vector< Classifier * > &classifiers_vector, const vector< ClassData > &classes_vector, const imat &ecoc_matrix, const mat &test_set_samples, const uvec &test_set_labels, uvec &results, umat &confussion)
u32 ecocpak::exponential_loss_weighted_decoding (const vector< Classifier * > &classifiers_vector, const vector< ClassData > &classes_vector, const imat &ecoc_matrix, const mat &test_set_samples, const uvec &test_set_labels, uvec &results, umat &confussion)
double ecocpak::custom_metric (rowvec test_code, rowvec class_code)
u32 ecocpak::custom_decoding (const vector< Classifier * > &classifiers_vector, const vector< ClassData > &classes_vector, const imat &coding_matrix, const mat &test_samples, const ucolvec &test_set_labels, uvec &predictions, umat &confussion)
void ecocpak::sigmoid_training (double &A, double &B, const vec f, const u32 n_pos, const u32 n_neg)
u32 ecocpak::probabilistic_decoding (const vector< Classifier * > &classifiers_vector, const vector< ClassData > &classes_vector, const imat &coding_matrix, const mat &test_samples, const ucolvec &test_set_labels, uvec &predictions, umat &confussion)
irowvec ecocpak::sign (const rowvec &A)
irowvec ecocpak::sign (const rowvec &A, const irowvec &B)
double ecocpak::beta_density_metric (const irowvec &test_code, const irowvec &class_code, const double u=0.333333, const u32 n_points=201)
u32 ecocpak::decode_codeword (const rowvec &codeword, const imat &coding_matrix, const int decoding_strategy)
void ecocpak::decode (const mat &Xt, const uvec &lt, const imat &coding_matrix, const vector< Classifier * > &classifiers_vector, const vector< ClassData > &classes_vector, const int decoding_option, uvec &predictions, u32 &n_missed, double &error, umat &confussion)
 Decoding procedure.
sparse_mat ecocpak::dense_to_sparse (const mat &X)
void ecocpak::delete_sparse_matrix (sparse_mat A, const u32 n_rows)
void ecocpak::delete_sparse_matrix (sparse_mat A, const u32 n_rows, const struct svm_model *model)
svm_model ecocpak::modelcpy (svm_model *m)
mat ecocpak::sparse_to_dense (struct svm_node **const X, const u32 n_rows, const u32 n_cols)
template<typename eT1 , typename eT2 >
Col< u32 > ecocpak::process_labels (const Mat< eT1 > &labels, Col< eT2 > &n_samples_each_class, u32 &n_classes)
template<typename eT1 >
Col< u32 > ecocpak::process_labels (const Mat< eT1 > &labels, u32 &n_classes)
template<typename eT1 >
Col< u32 > ecocpak::process_labels (const Mat< eT1 > &labels)
template<typename T1 >
void ecocpak::kmeans (Col< u32 > &indices_out, Col< u32 > &ranks_out, Mat< typename T1::elem_type > &centroids_out, const Base< typename T1::elem_type, T1 > &X, const u32 k, const typename T1::pod_type lr=0.01)
mat ecocpak::subClasses (ucolvec &inds, ucolvec &ranks, const mat &samples)
Classifierecocpak::construct_classifier (const mat &A, const mat &B, const int classifiers_type)
double ecocpak::compute_sigma (const vector< ClassData > &classes_vector)
template<typename T1 , typename T2 >
T1::elem_type ecocpak::fqmi (const Base< typename T1::elem_type, T1 > &X, const Base< typename T2::elem_type, T2 > &Y, const typename T1::elem_type sigma)
template<typename T1 >
T1::elem_type ecocpak::fldr (const Base< typename T1::elem_type, T1 > &X, const Base< typename T1::elem_type, T1 > &Y)
double ecocpak::criterion_custom (const vector< ClassData > &classes_vector, const ucolvec &indexPtr, const u32 curSubsetSize)
double ecocpak::criterion_fqmi (const vector< ClassData > &classes_vector, const ucolvec &indexPtr, const u32 curSubsetSize, const double sigma)
double ecocpak::criterion_fldr (const vector< ClassData > &classes_vector, const ucolvec &indexPtr, const u32 curSubsetSize)
double ecocpak::criterion (const vector< ClassData > &class_vector, const ucolvec &indexPtr, const u32 curSubSetSize, const u32 criterion_option, const double sigma)
ucolvec ecocpak::sffs (const vector< ClassData > &classes_vector, const u32 crit)
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)
u32 ecocpak::one_vs_one (const mat &training_samples, const icolvec &training_labels, const mat &testing_samples, const icolvec &testing_labels, const int decoding_strategy, const int classifiers_type, const bool verbose, ofstream &verbose_output, double &execution_time)
u32 ecocpak::one_vs_all (const mat &training_samples, const icolvec &training_labels, const mat &testing_samples, const icolvec &testing_labels, const int decoding_strategy, const int classifiers_type, const bool verbose, ofstream &verbose_output, double &execution_time)
u32 ecocpak::decoc (const mat &training_samples, const icolvec &training_labels, const mat &testing_samples, const icolvec &testing_labels, const int decoding_strategy, const int classifiers_option, const int criterion_option, const bool verbose, ofstream &verbose_output, double &execution_time)
 Discriminant Error Correcting Output Codes (DECOC) training and testing procedure.
u32 ecocpak::subdecoc (const mat &training_samples, const icolvec &training_labels, const mat &testing_samples, const icolvec &testing_labels, const Threshold &thres, const int decoding_strategy, const int classifiers_type, const int criterion_option, const bool verbose, imat &coding_matrix, ofstream &verbose_output, double &execution_time)
 Discriminant Error Correcting Output Codes with subclasses (SUBDECOC) training and testing procedure .
imat ecocpak::create_dense_matrix_from_rand (const double *random_matrix, const u32 n_rows, const u32 n_cols)
bool ecocpak::identical_columns_dense (const imat &coding_matrix)
imat ecocpak::create_dense_random_matrix (const u32 n_classes, const u32 n_classifiers, const u32 n_matrices)
u32 ecocpak::dense_random_ecoc (const mat &training_samples, const icolvec &training_labels, const mat &testing_samples, const icolvec &testing_labels, const int decoding_strategy, const int classifiers_type, const u32 n_matrices, const u32 n_desired_classifiers, const bool verbose, ofstream &verbose_output, double &execution_time)
imat ecocpak::create_sparse_matrix_from_rand (const double *random_matrix, const u32 n_rows, const u32 n_cols)
bool ecocpak::identical_columns_sparse (const imat &coding_matrix)
imat ecocpak::create_sparse_random_matrix (const u32 n_classes, const u32 n_classifiers, const u32 n_matrices)
u32 ecocpak::sparse_random_ecoc (const mat &training_samples, const icolvec &training_labels, const mat &testing_samples, const icolvec &testing_labels, const int decoding_strategy, const int classifiers_type, const u32 n_matrices, const u32 n_desired_classifiers, const bool verbose, ofstream &verbose_output, double &execution_time)
void ecocpak::one_vs_all_ecocone (vector< ClassData > &classes_vector, const int classifiers_type, imat &coding_matrix, vector< Classifier * > &classifiers_vector)
void ecocpak::one_vs_one_ecocone (vector< ClassData > &classes_vector, const int classifiers_type, imat &coding_matrix, vector< Classifier * > &classifiers_vector)
void ecocpak::decoc_ecocone (vector< ClassData > &classes_vector, const int classifiers_type, const int criterion_option, imat &coding_matrix, vector< Classifier * > &classifiers_vector)
void ecocpak::subdecoc_ecocone (vector< ClassData > &classes_vector, const int classifiers_type, const int criterion_option, const Threshold &thres, imat &coding_matrix, vector< Classifier * > &classifiers_vector)
void ecocpak::dense_random_ecocone (vector< ClassData > &classes_vector, const int classifiers_type, const u32 n_matrices, const u32 n_desired_classifiers, imat &coding_matrix, vector< Classifier * > &classifiers_vector)
void ecocpak::sparse_random_ecocone (vector< ClassData > &classes_vector, const int classifiers_type, const u32 n_matrices, const u32 n_desired_classifiers, imat &coding_matrix, vector< Classifier * > &classifiers_vector)
u32 ecocpak::ecoc_one (const mat &training_samples, const icolvec &training_labels, const mat &testing_samples, const icolvec &testing_labels, const Threshold &thres, const int decoding_strategy, const int classifiers_type, const int criterion_option, const u32 n_matrices, const u32 n_desired_classifiers, const double validation, const int init_coding_strategy, const int ecocone_mode, const u32 max_iter, const double epsilon, const double wv, const bool verbose, ofstream &verbose_output, double &elapsed_time)
 ECOC One training and testing procedure.
imat ecocpak::permvec (const ivec &A)
 Creates permutation vectors of input binary vector.
void ecocpak::append_tree (const vector< ClassData > &classes_vector, const ivec &root, const int criterion_option, const int classifiers_type, imat &M, vector< Classifier * > &classifiers_vector)
 Appends tree structure to coding matrix M.
u32 ecocpak::forest_ecoc (const mat &training_samples, const icolvec &training_labels, const mat &testing_samples, const icolvec &testing_labels, const int decoding_strategy, const int classifiers_type, const int criterion_option, const u32 n_forests, const bool verbose, ofstream &verbose_output, double &elapsed_time)
 Forest ECOC training and testing procedure.
void ecocpak::group_classes (const ivec &labels, int *nr_class_ret, int **label_ret, int **start_ret, int **count_ret, int *perm)
double ecocpak::cross_validation (const mat &samples, const icolvec &labels, const imat &codmat, const Threshold &thres, const u32 n_folds, const u32 n_classes, const u32 criterion_option, const u32 classifier_option, const int coding_strategy, const int decoding_strategy, const u32 n_matrices, const u32 n_desired_classifers, const double validation, const int init_coding_strategy, const int ecocone_mode, const u32 max_iter, const double epsilon, const double wvalidation, const bool verbose, double &mean_rows, double &mean_cols, double &elapsed_time, ofstream &output)
double ecocpak::cvonesvsone (const mat &samples, const icolvec &labels, const u32 n_folds, const u32 n_classes, const u32 classifier_option, const int decoding_strategy, const bool verbose, double &elapsed_time, ofstream &output)
double ecocpak::cvonesvsall (const mat &samples, const icolvec &labels, const u32 n_folds, const u32 n_classes, const u32 classifier_option, const int decoding_strategy, const bool verbose, double &elapsed_time, ofstream &output)
double ecocpak::cvdecoc (const mat &samples, const icolvec &labels, const u32 n_folds, const u32 n_classes, const u32 classifier_option, const int decoding_strategy, const u32 criterion_option, const bool verbose, double &elapsed_time, ofstream &output)
double ecocpak::cvsubdecoc (const mat &samples, const icolvec &labels, const u32 n_folds, const u32 n_classes, const u32 classifier_option, const int decoding_strategy, const u32 criterion_option, const Threshold &thres, const bool verbose, double &mr, double &mc, double &elapsed_time, ofstream &output)
double ecocpak::cvsparserand (const mat &samples, const icolvec &labels, const u32 n_folds, const u32 n_classes, const u32 classifier_option, const int decoding_strategy, const u32 n_matrices, const u32 n_desired_classifers, const bool verbose, double &elapsed_time, ofstream &output)
double ecocpak::cvdenserand (const mat &samples, const icolvec &labels, const u32 n_folds, const u32 n_classes, const u32 classifier_option, const int decoding_strategy, const u32 n_matrices, const u32 n_desired_classifers, const bool verbose, double &elapsed_time, ofstream &output)
double ecocpak::cvecocone (const mat &samples, const icolvec &labels, const u32 n_folds, const u32 n_classes, const u32 classifier_option, const int decoding_strategy, const double validation, const int init_coding_strategy, const int ecocone_mode, const u32 max_iter, const double epsilon, const double wvalidation, const bool verbose, double &elapsed_time, ofstream &output)
double ecocpak::cvforest (const mat &samples, const icolvec &labels, const u32 n_folds, const u32 n_classes, const u32 classifier_option, const int decoding_strategy, const u32 n_trees, const bool verbose, double &elapsed_time, ofstream &output)
double ecocpak::cvcustom (const mat &samples, const icolvec &labels, const u32 n_folds, const u32 n_classes, const u32 classifier_option, const int decoding_strategy, const imat &codmat, const bool verbose, double &elapsed_time, ofstream &output)
void ecocpak::uci_glass (mat &samples, ucolvec &labels)
mat ecocpak::uci_glass ()
void ecocpak::uci_iris (mat &samples, ucolvec &labels)
mat ecocpak::uci_iris ()
void ecocpak::load_dataset_from_file (const char *filename, mat &samples, icolvec &labels, u32 &n_classes)
void ecocpak::load_dataset_from_file (const char *filename, mat &samples, icolvec &labels)

Variables

struct svm_parameter param

Define Documentation

#define Malloc (   type,
 
)    (type *)malloc( ( n ) * sizeof( type ) )

Function Documentation

void print_null ( const char *  s)

Variable Documentation

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerator Defines