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 | Protected Attributes
CDomainAdaptationSVMLinear Class Reference

Detailed Description

class DomainAdaptationSVMLinear

Definition at line 25 of file DomainAdaptationSVMLinear.h.

Inheritance diagram for CDomainAdaptationSVMLinear:
Inheritance graph
[legend]

Public Member Functions

 CDomainAdaptationSVMLinear ()
 
 CDomainAdaptationSVMLinear (float64_t C, CDotFeatures *f, CLabels *lab, CLinearMachine *presvm, float64_t B)
 
virtual ~CDomainAdaptationSVMLinear ()
 
void init (CLinearMachine *presvm, float64_t B)
 
virtual EClassifierType get_classifier_type ()
 
virtual CLabelsapply (CDotFeatures *data)
 
virtual CLinearMachineget_presvm ()
 
virtual float64_t get_B ()
 
virtual float64_t get_train_factor ()
 
virtual void set_train_factor (float64_t factor)
 
virtual const char * get_name () const
 
- Public Member Functions inherited from CLibLinear
 CLibLinear ()
 
 CLibLinear (LIBLINEAR_SOLVER_TYPE liblinear_solver_type)
 
 CLibLinear (float64_t C, CDotFeatures *traindat, CLabels *trainlab)
 
virtual ~CLibLinear ()
 
LIBLINEAR_SOLVER_TYPE get_liblinear_solver_type ()
 
void set_liblinear_solver_type (LIBLINEAR_SOLVER_TYPE st)
 
void set_C (float64_t c_neg, float64_t c_pos)
 
float64_t get_C1 ()
 
float64_t get_C2 ()
 
void set_epsilon (float64_t eps)
 
float64_t get_epsilon ()
 
void set_bias_enabled (bool enable_bias)
 
bool get_bias_enabled ()
 
int32_t get_max_iterations ()
 
void set_max_iterations (int32_t max_iter=1000)
 
void set_linear_term (SGVector< float64_t > linear_term)
 
SGVector< float64_tget_linear_term ()
 
void init_linear_term ()
 
- 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" More...
 
virtual CDotFeaturesget_features ()
 
- 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 bool is_presvm_sane ()
 
virtual bool train_machine (CDotFeatures *data=NULL)
 
- Protected Member Functions inherited from CLibLinear
virtual bool train_machine (CFeatures *data=NULL)
 
- Protected Member Functions inherited from CLinearMachine
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

CLinearMachinepresvm
 
float64_t B
 
float64_t train_factor
 
- Protected Attributes inherited from CLibLinear
float64_t C1
 
float64_t C2
 
bool use_bias
 
float64_t epsilon
 
int32_t max_iterations
 
SGVector< float64_tm_linear_term
 
LIBLINEAR_SOLVER_TYPE liblinear_solver_type
 
- Protected Attributes inherited from CLinearMachine
int32_t w_dim
 
float64_tw
 
float64_t bias
 
CDotFeaturesfeatures
 
- Protected Attributes inherited from CMachine
float64_t max_train_time
 
CLabelslabels
 
ESolverType solver_type
 
bool m_store_model_features
 

Additional Inherited Members

- Public Attributes inherited from CSGObject
SGIOio
 
Parallelparallel
 
Versionversion
 
Parameterm_parameters
 
Parameterm_model_selection_parameters
 

Constructor & Destructor Documentation

default constructor

Definition at line 24 of file DomainAdaptationSVMLinear.cpp.

constructor

Parameters
Ccost constant C
ffeatures
lablabels
presvmtrained SVM to regularize against
Btrade-off constant B

Definition at line 30 of file DomainAdaptationSVMLinear.cpp.

destructor

Definition at line 37 of file DomainAdaptationSVMLinear.cpp.

Member Function Documentation

CLabels * apply ( CDotFeatures data)
virtual

classify objects

Parameters
data(test)data to be classified
Returns
classified labels

Definition at line 200 of file DomainAdaptationSVMLinear.cpp.

float64_t get_B ( )
virtual

getter for regularization parameter B

Returns
regularization parameter B

Definition at line 182 of file DomainAdaptationSVMLinear.cpp.

virtual EClassifierType get_classifier_type ( )
virtual

get classifier type

Returns
classifier type DASVMLINEAR

Reimplemented from CLibLinear.

Definition at line 60 of file DomainAdaptationSVMLinear.h.

virtual const char* get_name ( ) const
virtual

get linear term

Returns
lin the linear term
object name

Reimplemented from CLibLinear.

Definition at line 114 of file DomainAdaptationSVMLinear.h.

CLinearMachine * get_presvm ( )
virtual

returns SVM that is used as prior information

Returns
presvm

Definition at line 176 of file DomainAdaptationSVMLinear.cpp.

float64_t get_train_factor ( )
virtual

getter for train_factor

Returns
train_factor

Definition at line 188 of file DomainAdaptationSVMLinear.cpp.

void init ( CLinearMachine presvm,
float64_t  B 
)

init SVM

Parameters
presvmtrained SVM to regularize against
Btrade-off constant B

Definition at line 45 of file DomainAdaptationSVMLinear.cpp.

bool is_presvm_sane ( )
protectedvirtual

check sanity of presvm

Returns
true if sane, throws SG_ERROR otherwise

Definition at line 74 of file DomainAdaptationSVMLinear.cpp.

void set_train_factor ( float64_t  factor)
virtual

setter for train_factor

Definition at line 194 of file DomainAdaptationSVMLinear.cpp.

bool train_machine ( CDotFeatures data = NULL)
protectedvirtual

train SVM 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

Definition at line 97 of file DomainAdaptationSVMLinear.cpp.

Member Data Documentation

float64_t B
protected

regularization parameter B

Definition at line 141 of file DomainAdaptationSVMLinear.h.

CLinearMachine* presvm
protected

SVM to regularize against

Definition at line 137 of file DomainAdaptationSVMLinear.h.

float64_t train_factor
protected

flag to switch off regularization in training

Definition at line 145 of file DomainAdaptationSVMLinear.h.


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

SHOGUN Machine Learning Toolbox - Documentation