Public Member Functions | Protected Attributes

CLibLinear Class Reference

Detailed Description

class to implement LibLinear

Definition at line 47 of file LibLinear.h.

Inheritance diagram for CLibLinear:
Inheritance graph

List of all members.

Public Member Functions

 CLibLinear (void)
 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)
virtual bool train (CFeatures *data=NULL)
virtual EClassifierType get_classifier_type ()
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 ()
virtual const char * get_name () const
int32_t get_max_iterations ()
void set_max_iterations (int32_t max_iter=1000)
void set_linear_term (float64_t *linear_term, int32_t len)
void get_linear_term (float64_t **linear_term, int32_t *len)
void init_linear_term ()

Protected Attributes

float64_t C1
float64_t C2
bool use_bias
float64_t epsilon
int32_t max_iterations
int32_t m_linear_term_len
LIBLINEAR_SOLVER_TYPE liblinear_solver_type

Constructor & Destructor Documentation

CLibLinear ( void   ) 

default constructor

Definition at line 25 of file LibLinear.cpp.

CLibLinear ( LIBLINEAR_SOLVER_TYPE  liblinear_solver_type  ) 


liblinear_solver_type liblinear_solver_type

Definition at line 31 of file LibLinear.cpp.

CLibLinear ( float64_t  C,
CDotFeatures traindat,
CLabels trainlab 

constructor (using L2R_L1LOSS_SVC_DUAL as default)

C constant C
traindat training features
trainlab training labels

Definition at line 37 of file LibLinear.cpp.

~CLibLinear (  )  [virtual]


Definition at line 71 of file LibLinear.cpp.

Member Function Documentation

bool get_bias_enabled (  ) 

check if bias is enabled

if bias is enabled

Definition at line 139 of file LibLinear.h.

float64_t get_C1 (  ) 

get C1


Definition at line 109 of file LibLinear.h.

float64_t get_C2 (  ) 

get C2


Definition at line 115 of file LibLinear.h.

virtual EClassifierType get_classifier_type (  )  [virtual]

get classifier type

the classifier type

Reimplemented from CClassifier.

Reimplemented in CDomainAdaptationSVMLinear.

Definition at line 96 of file LibLinear.h.

float64_t get_epsilon (  ) 

get epsilon


Definition at line 127 of file LibLinear.h.

LIBLINEAR_SOLVER_TYPE get_liblinear_solver_type (  ) 

Definition at line 72 of file LibLinear.h.

void get_linear_term ( float64_t **  linear_term,
int32_t *  len 

get the linear term for qp

Definition at line 1146 of file LibLinear.cpp.

int32_t get_max_iterations (  ) 

get the maximum number of iterations liblinear is allowed to do

Definition at line 145 of file LibLinear.h.

virtual const char* get_name ( void   )  const [virtual]
object name

Reimplemented from CLinearClassifier.

Reimplemented in CDomainAdaptationSVMLinear.

Definition at line 142 of file LibLinear.h.

void init_linear_term (  ) 

set the linear term for qp

Definition at line 1157 of file LibLinear.cpp.

void set_bias_enabled ( bool  enable_bias  ) 

set if bias shall be enabled

enable_bias if bias shall be enabled

Definition at line 133 of file LibLinear.h.

void set_C ( float64_t  c_neg,
float64_t  c_pos 

set C

c_neg C1
c_pos C2

Definition at line 103 of file LibLinear.h.

void set_epsilon ( float64_t  eps  ) 

set epsilon

eps new epsilon

Definition at line 121 of file LibLinear.h.

void set_liblinear_solver_type ( LIBLINEAR_SOLVER_TYPE  st  ) 

Definition at line 77 of file LibLinear.h.

void set_linear_term ( float64_t linear_term,
int32_t  len 

set the linear term for qp

Definition at line 157 of file LibLinear.h.

void set_max_iterations ( int32_t  max_iter = 1000  ) 

set the maximum number of iterations liblinear is allowed to do

Definition at line 151 of file LibLinear.h.

bool train ( CFeatures data = NULL  )  [virtual]

train linear SVM classifier

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

Reimplemented from CClassifier.

Definition at line 76 of file LibLinear.cpp.

Member Data Documentation

float64_t C1 [protected]


Definition at line 194 of file LibLinear.h.

float64_t C2 [protected]


Definition at line 196 of file LibLinear.h.

float64_t epsilon [protected]


Definition at line 200 of file LibLinear.h.

solver type

Definition at line 210 of file LibLinear.h.

float64_t* m_linear_term [protected]

precomputed linear term

Definition at line 205 of file LibLinear.h.

int32_t m_linear_term_len [protected]

length of linear term

Definition at line 207 of file LibLinear.h.

int32_t max_iterations [protected]

maximum number of iterations

Definition at line 202 of file LibLinear.h.

bool use_bias [protected]

if bias shall be used

Definition at line 198 of file LibLinear.h.

The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation