SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
KernelRidgeRegression.h
浏览该文件的文档.
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>
16 
17 #ifdef HAVE_LAPACK
18 
20 #include <shogun/kernel/Kernel.h>
22 
23 namespace shogun
24 {
25 
28 {
30  PINV=1,
32  GS=2
33 };
34 
66 {
67  public:
70 
73 
82 
85 
90  inline void set_tau(float64_t tau) { m_tau = tau; };
91 
96  inline void set_epsilon(float64_t epsilon) { m_epsilon = epsilon; }
97 
103  virtual bool load(FILE* srcfile);
104 
110  virtual bool save(FILE* dstfile);
111 
117  {
119  }
120 
122  virtual const char* get_name() const { return "KernelRidgeRegression"; }
123 
124  protected:
133  virtual bool train_machine(CFeatures* data=NULL);
134 
135  private:
136  void init();
137 
142  bool train_machine_gs();
143 
148  bool train_machine_pinv();
149 
150  private:
152  float64_t m_tau;
153 
155  float64_t m_epsilon;
156 
158  ETrainingType m_train_func;
159 };
160 }
161 
162 #endif // HAVE_LAPACK
163 #endif // _KERNELRIDGEREGRESSION_H__
EMachineType
Definition: Machine.h:33
Class KernelRidgeRegression implements Kernel Ridge Regression - a regularized least square method fo...
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
MACHINE_PROBLEM_TYPE(PT_REGRESSION)
via pseudo inverse
A generic KernelMachine interface.
Definition: KernelMachine.h:51
void set_epsilon(float64_t epsilon)
static const float64_t epsilon
Definition: libbmrm.cpp:25
virtual const char * get_name() const
double float64_t
Definition: common.h:50
or gauss-seidel iterative method
virtual bool save(FILE *dstfile)
virtual EMachineType get_classifier_type()
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
The Kernel base class.
Definition: Kernel.h:158
virtual bool train_machine(CFeatures *data=NULL)
virtual bool load(FILE *srcfile)

SHOGUN 机器学习工具包 - 项目文档