Class SVRLight, performs support vector regression using SVMLight.
The SVR solution can be expressed as
where and
are determined in training, i.e. using a pre-specified kernel, a given tube-epsilon for the epsilon insensitive loss, the follwoing quadratic problem is minimized (using the chunking decomposition technique)
Note that the SV regression problem is reduced to the standard SV classification problem by introducing artificial labels which leads to the epsilon insensitive loss constraints *
with and
This implementation supports multiple kernel learning, i.e. if a CCombinedKernel is used the weights in
can be determined in training (cf. Large Scale Multiple Kernel Learning Sonnenburg, Raetsch, Schaefer, Schoelkopf 2006).
linadd optimizations were implemented for kernels that support it (most string kernels and the linear kernel), which will result in significant speedups.
Definition at line 62 of file SVRLight.h.
Public Member Functions | |
CSVRLight () | |
CSVRLight (float64_t C, float64_t epsilon, CKernel *k, CLabels *lab) | |
virtual | ~CSVRLight () |
virtual EClassifierType | get_classifier_type () |
void | svr_learn () |
virtual float64_t | compute_objective_function (float64_t *a, float64_t *lin, float64_t *c, float64_t *eps, int32_t *label, int32_t totdoc) |
virtual void | update_linear_component (int32_t *docs, int32_t *label, int32_t *active2dnum, float64_t *a, float64_t *a_old, int32_t *working2dnum, int32_t totdoc, float64_t *lin, float64_t *aicache, float64_t *c) |
virtual void | update_linear_component_mkl (int32_t *docs, int32_t *label, int32_t *active2dnum, float64_t *a, float64_t *a_old, int32_t *working2dnum, int32_t totdoc, float64_t *lin, float64_t *aicache, float64_t *c) |
virtual void | update_linear_component_mkl_linadd (int32_t *docs, int32_t *label, int32_t *active2dnum, float64_t *a, float64_t *a_old, int32_t *working2dnum, int32_t totdoc, float64_t *lin, float64_t *aicache, float64_t *c) |
void | call_mkl_callback (float64_t *a, int32_t *label, float64_t *lin, float64_t *c, int32_t totdoc) |
virtual void | reactivate_inactive_examples (int32_t *label, float64_t *a, SHRINK_STATE *shrink_state, float64_t *lin, float64_t *c, int32_t totdoc, int32_t iteration, int32_t *inconsistent, int32_t *docs, float64_t *aicache, float64_t *maxdiff) |
virtual const char * | get_name () const |
Protected Member Functions | |
int32_t | regression_fix_index (int32_t i) |
virtual float64_t | compute_kernel (int32_t i, int32_t j) |
virtual bool | train_machine (CFeatures *data=NULL) |
Static Protected Member Functions | |
static void * | update_linear_component_linadd_helper (void *params) |
static int32_t | regression_fix_index2 (int32_t i, int32_t num_vectors) |
Protected Attributes | |
int32_t | num_vectors |
CSVRLight | ( | ) |
default constructor
Definition at line 57 of file SVRLight.cpp.
constructor
C | constant C | |
epsilon | epsilon | |
k | kernel | |
lab | labels |
Definition at line 51 of file SVRLight.cpp.
virtual ~CSVRLight | ( | ) | [virtual] |
default destructor
Definition at line 78 of file SVRLight.h.
virtual float64_t compute_kernel | ( | int32_t | i, | |
int32_t | j | |||
) | [protected, virtual] |
compute kernel at given index
i | index i | |
j | index j |
Reimplemented from CSVMLight.
Definition at line 233 of file SVRLight.h.
float64_t compute_objective_function | ( | float64_t * | a, | |
float64_t * | lin, | |||
float64_t * | c, | |||
float64_t * | eps, | |||
int32_t * | label, | |||
int32_t | totdoc | |||
) | [virtual] |
compute objective function
a | a | |
lin | lin | |
c | c | |
eps | eps | |
label | label | |
totdoc | totdoc |
Reimplemented from CSVMLight.
Definition at line 327 of file SVRLight.cpp.
virtual EClassifierType get_classifier_type | ( | ) | [virtual] |
get classifier type
Reimplemented from CSVMLight.
Definition at line 84 of file SVRLight.h.
virtual const char* get_name | ( | void | ) | const [virtual] |
void reactivate_inactive_examples | ( | int32_t * | label, | |
float64_t * | a, | |||
SHRINK_STATE * | shrink_state, | |||
float64_t * | lin, | |||
float64_t * | c, | |||
int32_t | totdoc, | |||
int32_t | iteration, | |||
int32_t * | inconsistent, | |||
int32_t * | docs, | |||
float64_t * | aicache, | |||
float64_t * | maxdiff | |||
) | [virtual] |
reactivate inactive examples
label | label | |
a | a | |
shrink_state | shrink state | |
lin | lin | |
c | c | |
totdoc | totdoc | |
iteration | iteration | |
inconsistent | inconsistent | |
docs | docs | |
aicache | ai cache | |
maxdiff | maxdiff |
Reimplemented from CSVMLight.
Definition at line 637 of file SVRLight.cpp.
int32_t regression_fix_index | ( | int32_t | i | ) | [protected] |
static int32_t regression_fix_index2 | ( | int32_t | i, | |
int32_t | num_vectors | |||
) | [static, protected] |
regression fix index2
i | i | |
num_vectors | number of vectors |
Definition at line 218 of file SVRLight.h.
void svr_learn | ( | ) |
SVR learn
Definition at line 144 of file SVRLight.cpp.
bool train_machine | ( | CFeatures * | data = NULL |
) | [protected, virtual] |
train regression
data | training data (parameter can be avoided if distance or kernel-based regressors are used and distance/kernels are initialized with train data) |
Reimplemented from CSVMLight.
Definition at line 62 of file SVRLight.cpp.
void update_linear_component | ( | int32_t * | docs, | |
int32_t * | label, | |||
int32_t * | active2dnum, | |||
float64_t * | a, | |||
float64_t * | a_old, | |||
int32_t * | working2dnum, | |||
int32_t | totdoc, | |||
float64_t * | lin, | |||
float64_t * | aicache, | |||
float64_t * | c | |||
) | [virtual] |
update linear component
docs | docs | |
label | label | |
active2dnum | active2dnum | |
a | a | |
a_old | a old | |
working2dnum | working2dnum | |
totdoc | totdoc | |
lin | lin | |
aicache | ai cache | |
c | c |
Reimplemented from CSVMLight.
Definition at line 364 of file SVRLight.cpp.
void * update_linear_component_linadd_helper | ( | void * | params | ) | [static, protected] |
thread helper for update linear component linadd
params |
Reimplemented from CSVMLight.
Definition at line 351 of file SVRLight.cpp.
void update_linear_component_mkl | ( | int32_t * | docs, | |
int32_t * | label, | |||
int32_t * | active2dnum, | |||
float64_t * | a, | |||
float64_t * | a_old, | |||
int32_t * | working2dnum, | |||
int32_t | totdoc, | |||
float64_t * | lin, | |||
float64_t * | aicache, | |||
float64_t * | c | |||
) | [virtual] |
update linear component MKL
docs | docs | |
label | label | |
active2dnum | active2dnum | |
a | a | |
a_old | a old | |
working2dnum | working2dnum | |
totdoc | totdoc | |
lin | lin | |
aicache | ai cache | |
c | c |
Definition at line 462 of file SVRLight.cpp.
void update_linear_component_mkl_linadd | ( | int32_t * | docs, | |
int32_t * | label, | |||
int32_t * | active2dnum, | |||
float64_t * | a, | |||
float64_t * | a_old, | |||
int32_t * | working2dnum, | |||
int32_t | totdoc, | |||
float64_t * | lin, | |||
float64_t * | aicache, | |||
float64_t * | c | |||
) | [virtual] |
update linear component MKL linadd
docs | docs | |
label | label | |
active2dnum | active2dnum | |
a | a | |
a_old | a old | |
working2dnum | working2dnum | |
totdoc | totdoc | |
lin | lin | |
aicache | ai cache | |
c | c |
Definition at line 535 of file SVRLight.cpp.
int32_t num_vectors [protected] |
number of train elements
Definition at line 251 of file SVRLight.h.