Public Member Functions | Protected Attributes

CLibLinear Class Reference


Detailed Description

class to implement LibLinear

Definition at line 45 of file LibLinear.h.

Inheritance diagram for CLibLinear:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 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)

Protected Attributes

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

Constructor & Destructor Documentation

CLibLinear ( LIBLINEAR_SOLVER_TYPE  liblinear_solver_type  ) 

constructor

Parameters:
liblinear_solver_type liblinear_solver_type

Definition at line 24 of file LibLinear.cpp.

CLibLinear ( float64_t  C,
CDotFeatures traindat,
CLabels trainlab 
)

constructor

Parameters:
C constant C
traindat training features
trainlab training labels

Definition at line 34 of file LibLinear.cpp.

~CLibLinear (  )  [virtual]

Definition at line 45 of file LibLinear.cpp.


Member Function Documentation

bool get_bias_enabled (  ) 

check if bias is enabled

Returns:
if bias is enabled

Definition at line 133 of file LibLinear.h.

float64_t get_C1 (  ) 

get C1

Returns:
C1

Definition at line 103 of file LibLinear.h.

float64_t get_C2 (  ) 

get C2

Returns:
C2

Definition at line 109 of file LibLinear.h.

virtual EClassifierType get_classifier_type (  )  [virtual]

get classifier type

Returns:
the classifier type

Reimplemented from CClassifier.

Definition at line 90 of file LibLinear.h.

float64_t get_epsilon (  ) 

get epsilon

Returns:
epsilon

Definition at line 121 of file LibLinear.h.

LIBLINEAR_SOLVER_TYPE get_liblinear_solver_type (  ) 

Definition at line 66 of file LibLinear.h.

int32_t get_max_iterations (  ) 

get the maximum number of iterations liblinear is allowed to do

Definition at line 139 of file LibLinear.h.

virtual const char* get_name (  )  const [virtual]
Returns:
object name

Implements CSGObject.

Definition at line 136 of file LibLinear.h.

void set_bias_enabled ( bool  enable_bias  ) 

set if bias shall be enabled

Parameters:
enable_bias if bias shall be enabled

Definition at line 127 of file LibLinear.h.

void set_C ( float64_t  c_neg,
float64_t  c_pos 
)

set C

Parameters:
c_neg C1
c_pos C2

Definition at line 97 of file LibLinear.h.

void set_epsilon ( float64_t  eps  ) 

set epsilon

Parameters:
eps new epsilon

Definition at line 115 of file LibLinear.h.

void set_liblinear_solver_type ( LIBLINEAR_SOLVER_TYPE  st  ) 

Definition at line 71 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 145 of file LibLinear.h.

bool train ( CFeatures data = NULL  )  [virtual]

train linear SVM classifier

Parameters:
data training 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 CClassifier.

Definition at line 49 of file LibLinear.cpp.


Member Data Documentation

float64_t C1 [protected]

C1

Definition at line 161 of file LibLinear.h.

float64_t C2 [protected]

C2

Definition at line 163 of file LibLinear.h.

float64_t epsilon [protected]

epsilon

Definition at line 167 of file LibLinear.h.

solver type

Definition at line 172 of file LibLinear.h.

int32_t max_iterations [protected]

maximum number of iterations

Definition at line 169 of file LibLinear.h.

bool use_bias [protected]

if bias shall be used

Definition at line 165 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