SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KernelRidgeRegression.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) 2006 Mikio L. Braun
8  * Written (W) 1999-2009 Soeren Sonnenburg
9  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
10  */
11 
12 #ifndef _KERNELRIDGEREGRESSION_H__
13 #define _KERNELRIDGEREGRESSION_H__
14 
15 #include <shogun/lib/config.h>
17 
18 #ifdef HAVE_LAPACK
19 
21 
22 namespace shogun
23 {
24 
27 {
29  PINV=1,
31  GS=2
32 };
33 
65 {
66  public:
69 
72 
81 
84 
89  inline void set_tau(float64_t tau) { m_tau = tau; };
90 
95  inline void set_epsilon(float64_t epsilon) { m_epsilon = epsilon; }
96 
102  virtual bool load(FILE* srcfile);
103 
109  virtual bool save(FILE* dstfile);
110 
116  {
118  }
119 
121  inline virtual const char* get_name() const { return "KernelRidgeRegression"; }
122 
123  protected:
132  virtual bool train_machine(CFeatures* data=NULL);
133 
134  private:
135  void init();
136 
141  bool train_machine_gs();
142 
147  bool train_machine_pinv();
148 
149  private:
151  float64_t m_tau;
152 
154  float64_t m_epsilon;
155 
157  ETrainingType m_train_func;
158 };
159 }
160 
161 #endif // HAVE_LAPACK
162 #endif // _KERNELRIDGEREGRESSION_H__

SHOGUN Machine Learning Toolbox - Documentation