SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions
CMKLClassification Class Reference

Detailed Description

Multiple Kernel Learning for two-class-classification.

Learns an SVM classifier and its kernel weights. Makes only sense if multiple kernels are used.

See Also
CMKL

Definition at line 25 of file MKLClassification.h.

Inheritance diagram for CMKLClassification:
Inheritance graph
[legend]

Public Member Functions

 CMKLClassification (CSVM *s=NULL)
 
virtual ~CMKLClassification ()
 
virtual float64_t compute_sum_alpha ()
 
- Public Member Functions inherited from CMKL
 CMKL (CSVM *s=NULL)
 
virtual ~CMKL ()
 
void set_constraint_generator (CSVM *s)
 
void set_svm (CSVM *s)
 
CSVMget_svm ()
 
void set_C_mkl (float64_t C)
 
void set_mkl_norm (float64_t norm)
 
void set_elasticnet_lambda (float64_t elasticnet_lambda)
 
void set_mkl_block_norm (float64_t q)
 
void set_interleaved_optimization_enabled (bool enable)
 
bool get_interleaved_optimization_enabled ()
 
float64_t compute_mkl_primal_objective ()
 
virtual float64_t compute_mkl_dual_objective ()
 
float64_t compute_elasticnet_dual_objective ()
 
void set_mkl_epsilon (float64_t eps)
 
float64_t get_mkl_epsilon ()
 
int32_t get_mkl_iterations ()
 
virtual bool perform_mkl_step (const float64_t *sumw, float64_t suma)
 
virtual void compute_sum_beta (float64_t *sumw)
 
virtual const char * get_name () const
 
- Public Member Functions inherited from CSVM
 CSVM (int32_t num_sv=0)
 
 CSVM (float64_t C, CKernel *k, CLabels *lab)
 
virtual ~CSVM ()
 
void set_defaults (int32_t num_sv=0)
 
virtual SGVector< float64_tget_linear_term ()
 
virtual void set_linear_term (SGVector< float64_t > linear_term)
 
bool load (FILE *svm_file)
 
bool save (FILE *svm_file)
 
void set_nu (float64_t nue)
 
void set_C (float64_t c_neg, float64_t c_pos)
 
void set_epsilon (float64_t eps)
 
void set_tube_epsilon (float64_t eps)
 
float64_t get_tube_epsilon ()
 
void set_qpsize (int32_t qps)
 
float64_t get_epsilon ()
 
float64_t get_nu ()
 
float64_t get_C1 ()
 
float64_t get_C2 ()
 
int32_t get_qpsize ()
 
void set_shrinking_enabled (bool enable)
 
bool get_shrinking_enabled ()
 
float64_t compute_svm_dual_objective ()
 
float64_t compute_svm_primal_objective ()
 
void set_objective (float64_t v)
 
float64_t get_objective ()
 
void set_callback_function (CMKL *m, bool(*cb)(CMKL *mkl, const float64_t *sumw, const float64_t suma))
 
- Public Member Functions inherited from CKernelMachine
 CKernelMachine ()
 
virtual ~CKernelMachine ()
 
void set_kernel (CKernel *k)
 
CKernelget_kernel ()
 
void set_batch_computation_enabled (bool enable)
 
bool get_batch_computation_enabled ()
 
void set_linadd_enabled (bool enable)
 
bool get_linadd_enabled ()
 
void set_bias_enabled (bool enable_bias)
 
bool get_bias_enabled ()
 
float64_t get_bias ()
 
void set_bias (float64_t bias)
 
int32_t get_support_vector (int32_t idx)
 
float64_t get_alpha (int32_t idx)
 
bool set_support_vector (int32_t idx, int32_t val)
 
bool set_alpha (int32_t idx, float64_t val)
 
int32_t get_num_support_vectors ()
 
void set_alphas (SGVector< float64_t > alphas)
 
void set_support_vectors (SGVector< int32_t > svs)
 
SGVector< int32_t > get_support_vectors ()
 
SGVector< float64_tget_alphas ()
 
bool create_new_model (int32_t num)
 
bool init_kernel_optimization ()
 
virtual CLabelsapply ()
 
virtual CLabelsapply (CFeatures *data)
 
virtual float64_t apply (int32_t num)
 
- Public Member Functions inherited from CMachine
 CMachine ()
 
virtual ~CMachine ()
 
virtual bool train (CFeatures *data=NULL)
 
virtual void set_labels (CLabels *lab)
 
virtual CLabelsget_labels ()
 
virtual float64_t get_label (int32_t i)
 
void set_max_train_time (float64_t t)
 
float64_t get_max_train_time ()
 
void set_solver_type (ESolverType st)
 
ESolverType get_solver_type ()
 
virtual void set_store_model_features (bool store_model)
 
- Public Member Functions inherited from CSGObject
 CSGObject ()
 
 CSGObject (const CSGObject &orig)
 
virtual ~CSGObject ()
 
virtual bool is_generic (EPrimitiveType *generic) const
 
template<class T >
void set_generic ()
 
void unset_generic ()
 
virtual void print_serializable (const char *prefix="")
 
virtual bool save_serializable (CSerializableFile *file, const char *prefix="")
 
virtual bool load_serializable (CSerializableFile *file, const char *prefix="")
 
void set_global_io (SGIO *io)
 
SGIOget_global_io ()
 
void set_global_parallel (Parallel *parallel)
 
Parallelget_global_parallel ()
 
void set_global_version (Version *version)
 
Versionget_global_version ()
 
SGVector< char * > get_modelsel_names ()
 
char * get_modsel_param_descr (const char *param_name)
 
index_t get_modsel_param_index (const char *param_name)
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 
template<>
void set_generic ()
 

Protected Member Functions

virtual void init_training ()
 
virtual EClassifierType get_classifier_type ()
 
- Protected Member Functions inherited from CMKL
virtual bool train_machine (CFeatures *data=NULL)
 
void perform_mkl_step (float64_t *beta, float64_t *old_beta, int num_kernels, int32_t *label, int32_t *active2dnum, float64_t *a, float64_t *lin, float64_t *sumw, int32_t &inner_iters)
 
float64_t compute_optimal_betas_via_cplex (float64_t *beta, const float64_t *old_beta, int32_t num_kernels, const float64_t *sumw, float64_t suma, int32_t &inner_iters)
 
float64_t compute_optimal_betas_via_glpk (float64_t *beta, const float64_t *old_beta, int num_kernels, const float64_t *sumw, float64_t suma, int32_t &inner_iters)
 
float64_t compute_optimal_betas_elasticnet (float64_t *beta, const float64_t *old_beta, const int32_t num_kernels, const float64_t *sumw, const float64_t suma, const float64_t mkl_objective)
 
void elasticnet_transform (float64_t *beta, float64_t lmd, int32_t len)
 
void elasticnet_dual (float64_t *ff, float64_t *gg, float64_t *hh, const float64_t &del, const float64_t *nm, int32_t len, const float64_t &lambda)
 
float64_t compute_optimal_betas_directly (float64_t *beta, const float64_t *old_beta, const int32_t num_kernels, const float64_t *sumw, const float64_t suma, const float64_t mkl_objective)
 
float64_t compute_optimal_betas_block_norm (float64_t *beta, const float64_t *old_beta, const int32_t num_kernels, const float64_t *sumw, const float64_t suma, const float64_t mkl_objective)
 
float64_t compute_optimal_betas_newton (float64_t *beta, const float64_t *old_beta, int32_t num_kernels, const float64_t *sumw, float64_t suma, float64_t mkl_objective)
 
virtual bool converged ()
 
void init_solver ()
 
bool init_cplex ()
 
void set_qnorm_constraints (float64_t *beta, int32_t num_kernels)
 
bool cleanup_cplex ()
 
bool init_glpk ()
 
bool cleanup_glpk ()
 
bool check_lpx_status (LPX *lp)
 
- Protected Member Functions inherited from CSVM
virtual float64_tget_linear_term_array ()
 
- Protected Member Functions inherited from CKernelMachine
virtual void store_model_features ()
 
- Protected Member Functions inherited from CSGObject
virtual void load_serializable_pre () throw (ShogunException)
 
virtual void load_serializable_post () throw (ShogunException)
 
virtual void save_serializable_pre () throw (ShogunException)
 
virtual void save_serializable_post () throw (ShogunException)
 

Additional Inherited Members

- Static Public Member Functions inherited from CMKL
static bool perform_mkl_step_helper (CMKL *mkl, const float64_t *sumw, const float64_t suma)
 
- Static Public Member Functions inherited from CKernelMachine
static void * apply_helper (void *p)
 
- Public Attributes inherited from CSGObject
SGIOio
 
Parallelparallel
 
Versionversion
 
Parameterm_parameters
 
Parameterm_model_selection_parameters
 
- Protected Attributes inherited from CMKL
CSVMsvm
 
float64_t C_mkl
 
float64_t mkl_norm
 
float64_t ent_lambda
 
float64_t mkl_block_norm
 
float64_tbeta_local
 
int32_t mkl_iterations
 
float64_t mkl_epsilon
 
bool interleaved_optimization
 
float64_tW
 
float64_t w_gap
 
float64_t rho
 
CTime training_time_clock
 
CPXENVptr env
 
CPXLPptr lp_cplex
 
LPX * lp_glpk
 
bool lp_initialized
 
- Protected Attributes inherited from CSVM
SGVector< float64_tm_linear_term
 
bool svm_loaded
 
float64_t epsilon
 
float64_t tube_epsilon
 
float64_t nu
 
float64_t C1
 
float64_t C2
 
float64_t objective
 
int32_t qpsize
 
bool use_shrinking
 
bool(* callback )(CMKL *mkl, const float64_t *sumw, const float64_t suma)
 
CMKLmkl
 
- Protected Attributes inherited from CKernelMachine
CKernelkernel
 
bool use_batch_computation
 
bool use_linadd
 
bool use_bias
 
float64_t m_bias
 
SGVector< float64_tm_alpha
 
SGVector< int32_t > m_svs
 
- Protected Attributes inherited from CMachine
float64_t max_train_time
 
CLabelslabels
 
ESolverType solver_type
 
bool m_store_model_features
 

Constructor & Destructor Documentation

CMKLClassification ( CSVM s = NULL)

Constructor

Parameters
sSVM to use as constraint generator in MKL SILP

Definition at line 7 of file MKLClassification.cpp.

~CMKLClassification ( )
virtual

Destructor

Definition at line 18 of file MKLClassification.cpp.

Member Function Documentation

float64_t compute_sum_alpha ( )
virtual

compute beta independent term from objective, e.g., in 2-class MKL sum_i alpha_i etc

Implements CMKL.

Definition at line 21 of file MKLClassification.cpp.

virtual EClassifierType get_classifier_type ( )
protectedvirtual

get classifier type

Returns
classifier type MKL_CLASSIFICATION

Reimplemented from CMachine.

Definition at line 53 of file MKLClassification.h.

void init_training ( )
protectedvirtual

check run before starting training (to e.g. check if labeling is two-class labeling in classification case

Implements CMKL.

Definition at line 31 of file MKLClassification.cpp.


The documentation for this class was generated from the following files:

SHOGUN Machine Learning Toolbox - Documentation