SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LibLinearRegression.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  * Copyright (C) 2012 Soeren Sonnenburg
8  */
9 
10 #ifndef _REGRESSIONLIBLINEAR_H___
11 #define _REGRESSIONLIBLINEAR_H___
12 #include <shogun/lib/config.h>
13 #ifdef HAVE_LAPACK
14 #include <shogun/lib/common.h>
18 
19 namespace shogun
20 {
23  {
30  };
31 
35 {
36  public:
38 
39 
41 
48 
50  virtual ~CLibLinearRegression();
51 
54  {
56  }
57 
60  {
62  }
63 
65  virtual const char* get_name() const
66  {
67  return "LibLinearRegression";
68  }
69 
73  inline void set_C(float64_t C)
74  {
75  ASSERT(C>0);
76  m_C = C;
77  }
78 
82  inline float64_t get_C() const { return m_C; }
83 
88  inline void set_tube_epsilon(float64_t eps) { m_tube_epsilon=eps; }
89 
95 
96 
101  {
102  ASSERT(epsilon>0);
103  m_epsilon = epsilon;
104  }
105 
109  inline float64_t get_epsilon() const { return m_epsilon; }
110 
114  inline void set_use_bias(bool use_bias)
115  {
116  m_use_bias = use_bias;
117  }
121  inline bool get_use_bias() const
122  {
123  return m_use_bias;
124  }
125 
129  inline void set_max_iter(int32_t max_iter)
130  {
131  ASSERT(max_iter>0);
132  m_max_iter = max_iter;
133  }
137  inline int32_t get_max_iter() const { return m_max_iter; }
138 
139 protected:
140 
142  virtual bool train_machine(CFeatures* data = NULL);
143 
144 private:
146  void solve_l2r_l1l2_svr(const problem *prob);
147 
149  void init_defaults();
150 
152  void register_parameters();
153 
154 protected:
155 
158 
161 
164 
166  int32_t m_max_iter;
167 
170 
173 };
174 }
175 #endif /* HAVE_LAPACK */
176 #endif

SHOGUN Machine Learning Toolbox - Documentation