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
CSGDQN Class Reference

Detailed Description

class SGDQN

Definition at line 34 of file SGDQN.h.

Inheritance diagram for CSGDQN:
Inheritance graph
[legend]

Public Member Functions

 CSGDQN ()
 CSGDQN (float64_t C)
 CSGDQN (float64_t C, CDotFeatures *traindat, CLabels *trainlab)
virtual ~CSGDQN ()
virtual EClassifierType get_classifier_type ()
virtual bool train (CFeatures *data=NULL)
void set_C (float64_t c_neg, float64_t c_pos)
float64_t get_C1 ()
float64_t get_C2 ()
void set_epochs (int32_t e)
int32_t get_epochs ()
void compute_ratio (float64_t *W, float64_t *W_1, float64_t *B, float64_t *dst, int32_t dim, float64_t regularizer_lambda, float64_t loss)
void combine_and_clip (float64_t *Bc, float64_t *B, int32_t dim, float64_t c1, float64_t c2, float64_t v1, float64_t v2)
void set_loss_function (CLossFunction *loss_func)
CLossFunctionget_loss_function ()
virtual const char * get_name () const
- Public Member Functions inherited from CLinearMachine
 CLinearMachine ()
virtual ~CLinearMachine ()
void get_w (float64_t *&dst_w, int32_t &dst_dims)
SGVector< float64_tget_w ()
void set_w (SGVector< float64_t > src_w)
void set_bias (float64_t b)
float64_t get_bias ()
virtual bool load (FILE *srcfile)
virtual bool save (FILE *dstfile)
virtual void set_features (CDotFeatures *feat)
virtual CLabelsapply ()
virtual CLabelsapply (CFeatures *data)
virtual float64_t apply (int32_t vec_idx)
 get output for example "vec_idx"
virtual CDotFeaturesget_features ()
- Public Member Functions inherited from CMachine
 CMachine ()
virtual ~CMachine ()
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)

Protected Member Functions

void calibrate ()
- Protected Member Functions inherited from CLinearMachine
virtual void store_model_features ()
- Protected Member Functions inherited from CMachine
virtual bool train_machine (CFeatures *data=NULL)
- 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

- Public Attributes inherited from CSGObject
SGIOio
Parallelparallel
Versionversion
Parameterm_parameters
Parameterm_model_selection_parameters
- Protected Attributes inherited from CLinearMachine
int32_t w_dim
float64_tw
float64_t bias
CDotFeaturesfeatures

Constructor & Destructor Documentation

CSGDQN ( )

default constructor

Definition at line 30 of file SGDQN.cpp.

CSGDQN ( float64_t  C)

constructor

Parameters
Cconstant C

Definition at line 36 of file SGDQN.cpp.

CSGDQN ( float64_t  C,
CDotFeatures traindat,
CLabels trainlab 
)

constructor

Parameters
Cconstant C
traindattraining features
trainlablabels for training features

Definition at line 45 of file SGDQN.cpp.

~CSGDQN ( )
virtual

Definition at line 56 of file SGDQN.cpp.

Member Function Documentation

void calibrate ( )
protected

calibrate

Definition at line 212 of file SGDQN.cpp.

void combine_and_clip ( float64_t Bc,
float64_t B,
int32_t  dim,
float64_t  c1,
float64_t  c2,
float64_t  v1,
float64_t  v2 
)

combine and clip scaling matrix B

Definition at line 81 of file SGDQN.cpp.

void compute_ratio ( float64_t W,
float64_t W_1,
float64_t B,
float64_t dst,
int32_t  dim,
float64_t  regularizer_lambda,
float64_t  loss 
)

computing diagonal scaling matrix B as ratio

Definition at line 69 of file SGDQN.cpp.

float64_t get_C1 ( )

get C1

Returns
C1

Definition at line 86 of file SGDQN.h.

float64_t get_C2 ( )

get C2

Returns
C2

Definition at line 92 of file SGDQN.h.

virtual EClassifierType get_classifier_type ( )
virtual

get classifier type

Returns
classifier type SVMSGDQN

Reimplemented from CMachine.

Definition at line 62 of file SGDQN.h.

int32_t get_epochs ( )

get epochs

Returns
the number of training epochs

Definition at line 104 of file SGDQN.h.

CLossFunction* get_loss_function ( )

Return the loss function

Returns
loss function as CLossFunction*

Definition at line 122 of file SGDQN.h.

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

Reimplemented from CLinearMachine.

Definition at line 125 of file SGDQN.h.

void set_C ( float64_t  c_neg,
float64_t  c_pos 
)

set C

Parameters
c_negnew C constant for negatively labeled examples
c_posnew C constant for positively labeled examples

Definition at line 80 of file SGDQN.h.

void set_epochs ( int32_t  e)

set epochs

Parameters
enew number of training epochs

Definition at line 98 of file SGDQN.h.

void set_loss_function ( CLossFunction loss_func)

Set the loss function to use

Parameters
loss_funcobject derived from CLossFunction

Definition at line 61 of file SGDQN.cpp.

bool train ( CFeatures data = NULL)
virtual

train classifier

Parameters
datatraining data (parameter can be avoided if distance or kernel-based classifiers are used and distance/kernels are initialized with train data)
Returns
whether training was successful

Reimplemented from CMachine.

Definition at line 93 of file SGDQN.cpp.


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

SHOGUN Machine Learning Toolbox - Documentation