SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SVRLight.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 1999-2009 Soeren Sonnenburg
8  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef _SVRLight_H___
12 #define _SVRLight_H___
13 
14 #include <shogun/lib/config.h>
16 
17 #ifdef USE_SVMLIGHT
19 #endif //USE_SVMLIGHT
20 
21 #ifdef USE_SVMLIGHT
22 namespace shogun
23 {
62 class CSVRLight: public CSVMLight
63 {
64  public:
67 
69  CSVRLight();
70 
79 
81  virtual ~CSVRLight();
82 
88 
90  void svr_learn();
91 
102  float64_t *a, float64_t *lin, float64_t *c, float64_t* eps,
103  int32_t *label, int32_t totdoc);
104 
118  virtual void update_linear_component(
119  int32_t* docs, int32_t *label,
120  int32_t *active2dnum, float64_t *a, float64_t* a_old,
121  int32_t *working2dnum, int32_t totdoc,
122  float64_t *lin, float64_t *aicache, float64_t* c);
123 
137  virtual void update_linear_component_mkl(
138  int32_t* docs, int32_t *label,
139  int32_t *active2dnum, float64_t *a, float64_t* a_old,
140  int32_t *working2dnum, int32_t totdoc,
141  float64_t *lin, float64_t *aicache, float64_t* c);
142 
157  int32_t* docs, int32_t *label,
158  int32_t *active2dnum, float64_t *a, float64_t* a_old,
159  int32_t *working2dnum, int32_t totdoc,
160  float64_t *lin, float64_t *aicache, float64_t* c);
161 
169  void call_mkl_callback(float64_t* a, int32_t* label, float64_t* lin, float64_t* c, int32_t totdoc);
170 
185  virtual void reactivate_inactive_examples(
186  int32_t *label,float64_t *a,SHRINK_STATE *shrink_state,
187  float64_t *lin, float64_t *c, int32_t totdoc,int32_t iteration,
188  int32_t *inconsistent,
189  int32_t *docs,float64_t *aicache,
190  float64_t* maxdiff);
191 
193  virtual const char* get_name() const { return "SVRLight"; }
194 
195  protected:
200  static void* update_linear_component_linadd_helper(void *params);
201 
207  int32_t regression_fix_index(int32_t i);
208 
215  static int32_t regression_fix_index2(
216  int32_t i, int32_t num_vectors);
217 
224  virtual float64_t compute_kernel(int32_t i, int32_t j);
225 
234  virtual bool train_machine(CFeatures* data=NULL);
235 
237  int32_t num_vectors;
238 };
239 }
240 #endif //USE_SVMLIGHT
241 #endif

SHOGUN Machine Learning Toolbox - Documentation