|
SHOGUN
v1.1.0
|
class to implement LibLinear
Definition at line 47 of file LibLinear.h.

Public Member Functions | |
| 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) |
| 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 (SGVector< float64_t > linear_term) |
| SGVector< float64_t > | get_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_t > | get_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 CLabels * | apply () |
| virtual CLabels * | apply (CFeatures *data) |
| virtual float64_t | apply (int32_t vec_idx) |
| get output for example "vec_idx" More... | |
| virtual CDotFeatures * | get_features () |
Public Member Functions inherited from CMachine | |
| CMachine () | |
| virtual | ~CMachine () |
| virtual bool | train (CFeatures *data=NULL) |
| virtual void | set_labels (CLabels *lab) |
| virtual CLabels * | get_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) |
| SGIO * | get_global_io () |
| void | set_global_parallel (Parallel *parallel) |
| Parallel * | get_global_parallel () |
| void | set_global_version (Version *version) |
| Version * | get_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 | 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 | |
| float64_t | C1 |
| float64_t | C2 |
| bool | use_bias |
| float64_t | epsilon |
| int32_t | max_iterations |
| SGVector< float64_t > | m_linear_term |
| LIBLINEAR_SOLVER_TYPE | liblinear_solver_type |
Protected Attributes inherited from CLinearMachine | |
| int32_t | w_dim |
| float64_t * | w |
| float64_t | bias |
| CDotFeatures * | features |
Protected Attributes inherited from CMachine | |
| float64_t | max_train_time |
| CLabels * | labels |
| ESolverType | solver_type |
| bool | m_store_model_features |
Additional Inherited Members | |
Public Attributes inherited from CSGObject | |
| SGIO * | io |
| Parallel * | parallel |
| Version * | version |
| Parameter * | m_parameters |
| Parameter * | m_model_selection_parameters |
| CLibLinear | ( | ) |
default constructor
Definition at line 25 of file LibLinear.cpp.
| CLibLinear | ( | LIBLINEAR_SOLVER_TYPE | liblinear_solver_type | ) |
constructor
| 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 38 of file LibLinear.cpp.
|
virtual |
destructor
Definition at line 73 of file LibLinear.cpp.
| bool get_bias_enabled | ( | ) |
| float64_t get_C1 | ( | ) |
| float64_t get_C2 | ( | ) |
|
virtual |
get classifier type
Reimplemented from CMachine.
Reimplemented in CDomainAdaptationSVMLinear.
Definition at line 86 of file LibLinear.h.
| float64_t get_epsilon | ( | ) |
| LIBLINEAR_SOLVER_TYPE get_liblinear_solver_type | ( | ) |
Definition at line 72 of file LibLinear.h.
get the linear term for qp
Definition at line 1148 of file LibLinear.cpp.
| int32_t get_max_iterations | ( | ) |
get the maximum number of iterations liblinear is allowed to do
Definition at line 135 of file LibLinear.h.
|
virtual |
Reimplemented from CLinearMachine.
Reimplemented in CDomainAdaptationSVMLinear.
Definition at line 132 of file LibLinear.h.
| void init_linear_term | ( | ) |
set the linear term for qp
Definition at line 1156 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 123 of file LibLinear.h.
| void set_epsilon | ( | float64_t | eps | ) |
| void set_liblinear_solver_type | ( | LIBLINEAR_SOLVER_TYPE | st | ) |
Definition at line 77 of file LibLinear.h.
set the linear term for qp
Definition at line 147 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 141 of file LibLinear.h.
|
protectedvirtual |
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) |
Reimplemented from CMachine.
Definition at line 78 of file LibLinear.cpp.
|
protected |
C1
Definition at line 198 of file LibLinear.h.
|
protected |
C2
Definition at line 200 of file LibLinear.h.
|
protected |
epsilon
Definition at line 204 of file LibLinear.h.
|
protected |
solver type
Definition at line 212 of file LibLinear.h.
precomputed linear term
Definition at line 209 of file LibLinear.h.
|
protected |
maximum number of iterations
Definition at line 206 of file LibLinear.h.
|
protected |
if bias shall be used
Definition at line 202 of file LibLinear.h.