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

Detailed Description

the LaRank multiclass SVM machine

Definition at line 308 of file LaRank.h.

Inheritance diagram for CLaRank:
Inheritance graph
[legend]

Public Member Functions

 CLaRank ()
 
 CLaRank (float64_t C, CKernel *k, CLabels *lab)
 
virtual ~CLaRank ()
 
virtual int32_t add (int32_t x_id, int32_t yi)
 
virtual int32_t predict (int32_t x_id)
 
virtual void destroy ()
 
virtual float64_t computeGap ()
 
virtual uint32_t getNumOutputs () const
 
int32_t getNSV ()
 
float64_t computeW2 ()
 
float64_t getDual ()
 
virtual EClassifierType get_classifier_type ()
 
virtual const char * get_name () const
 
void set_batch_mode (bool enable)
 
bool get_batch_mode ()
 
void set_tau (float64_t t)
 
float64_t get_tau ()
 
- Public Member Functions inherited from CMultiClassSVM
 CMultiClassSVM ()
 
 CMultiClassSVM (EMultiClassSVM type)
 
 CMultiClassSVM (EMultiClassSVM type, float64_t C, CKernel *k, CLabels *lab)
 
virtual ~CMultiClassSVM ()
 
bool create_multiclass_svm (int32_t num_classes)
 
bool set_svm (int32_t num, CSVM *svm)
 
CSVMget_svm (int32_t num)
 
int32_t get_num_svms ()
 
void cleanup ()
 
virtual CLabelsapply ()
 
virtual CLabelsapply (CFeatures *data)
 
virtual float64_t apply (int32_t num)
 
virtual CLabelsclassify_one_vs_rest ()
 
virtual float64_t classify_example_one_vs_rest (int32_t num)
 
CLabelsclassify_one_vs_one ()
 
float64_t classify_example_one_vs_one (int32_t num)
 
bool load (FILE *svm_file)
 
bool save (FILE *svm_file)
 
EMultiClassSVM get_multiclass_type ()
 
- 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 ()
 
- 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

bool train_machine (CFeatures *data)
 
uint32_t class_count () const
 class count More...
 
- 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)
 

Protected Attributes

std_hash_set< int32_t > classes
 classes More...
 
float64_t tau
 tau More...
 
int32_t nb_train
 nb train More...
 
int64_t cache
 cache More...
 
bool batch_mode
 whether to use online learning or batch training More...
 
int32_t step
 progess output More...
 
- Protected Attributes inherited from CMultiClassSVM
EMultiClassSVM multiclass_type
 
int32_t m_num_classes
 
int32_t m_num_svms
 
CSVM ** m_svms
 
- 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
 

Additional Inherited Members

- 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
 

Constructor & Destructor Documentation

CLaRank ( )

Definition at line 582 of file LaRank.cpp.

CLaRank ( float64_t  C,
CKernel k,
CLabels lab 
)

constructor

Parameters
Cconstant C
kkernel
lablabels

Definition at line 590 of file LaRank.cpp.

~CLaRank ( )
virtual

Definition at line 599 of file LaRank.cpp.

Member Function Documentation

int32_t add ( int32_t  x_id,
int32_t  yi 
)
virtual

add

Parameters
x_id
yi

Definition at line 696 of file LaRank.cpp.

uint32_t class_count ( ) const
protected

class count

Definition at line 473 of file LaRank.h.

float64_t computeGap ( )
virtual

computeGap

Definition at line 797 of file LaRank.cpp.

float64_t computeW2 ( )

compute W2

Definition at line 847 of file LaRank.cpp.

void destroy ( )
virtual

destroy

Definition at line 789 of file LaRank.cpp.

bool get_batch_mode ( )

get batch mode

Definition at line 374 of file LaRank.h.

virtual EClassifierType get_classifier_type ( )
virtual

get classifier type

Returns
classifier type LIBSVM

Reimplemented from CMachine.

Definition at line 364 of file LaRank.h.

virtual const char* get_name ( ) const
virtual
Returns
object name

Reimplemented from CSVM.

Definition at line 367 of file LaRank.h.

float64_t get_tau ( )

get tau

Returns
tau

Definition at line 382 of file LaRank.h.

float64_t getDual ( )

get Dual

Definition at line 863 of file LaRank.cpp.

int32_t getNSV ( )

get NSV

Definition at line 834 of file LaRank.cpp.

uint32_t getNumOutputs ( ) const
virtual

get num outputs

Definition at line 828 of file LaRank.cpp.

int32_t predict ( int32_t  x_id)
virtual

predict

Parameters
x_id

Definition at line 773 of file LaRank.cpp.

void set_batch_mode ( bool  enable)

set batch mode

Parameters
enable

Definition at line 372 of file LaRank.h.

void set_tau ( float64_t  t)

set tau

Parameters
t

Definition at line 378 of file LaRank.h.

bool train_machine ( CFeatures data)
protectedvirtual

train machine

Reimplemented from CMachine.

Definition at line 604 of file LaRank.cpp.

Member Data Documentation

bool batch_mode
protected

whether to use online learning or batch training

Definition at line 486 of file LaRank.h.

int64_t cache
protected

cache

Definition at line 484 of file LaRank.h.

std_hash_set< int32_t > classes
protected

classes

Definition at line 470 of file LaRank.h.

int32_t nb_train
protected

nb train

Definition at line 482 of file LaRank.h.

int32_t step
protected

progess output

Definition at line 489 of file LaRank.h.

float64_t tau
protected

tau

Definition at line 479 of file LaRank.h.


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

SHOGUN Machine Learning Toolbox - Documentation