SHOGUN  5.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules
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 
47 {
48  public:
50 
51 
53 
60 
62  virtual ~CLibLinearRegression();
63 
66  {
68  }
69 
72  {
74  }
75 
77  virtual const char* get_name() const
78  {
79  return "LibLinearRegression";
80  }
81 
85  inline void set_C(float64_t C)
86  {
87  ASSERT(C>0)
88  m_C = C;
89  }
90 
94  inline float64_t get_C() const { return m_C; }
95 
100  inline void set_tube_epsilon(float64_t eps) { m_tube_epsilon=eps; }
101 
107 
108 
112  inline void set_epsilon(float64_t epsilon)
113  {
114  ASSERT(epsilon>0)
115  m_epsilon = epsilon;
116  }
117 
121  inline float64_t get_epsilon() const { return m_epsilon; }
122 
126  inline void set_use_bias(bool use_bias)
127  {
128  m_use_bias = use_bias;
129  }
133  inline bool get_use_bias() const
134  {
135  return m_use_bias;
136  }
137 
141  inline void set_max_iter(int32_t max_iter)
142  {
143  ASSERT(max_iter>0)
144  m_max_iter = max_iter;
145  }
149  inline int32_t get_max_iter() const { return m_max_iter; }
150 
151 protected:
152 
154  virtual bool train_machine(CFeatures* data = NULL);
155 
156 private:
158  void solve_l2r_l1l2_svr(const liblinear_problem *prob);
159 
161  void init_defaults();
162 
164  void register_parameters();
165 
166 protected:
167 
170 
173 
176 
178  int32_t m_max_iter;
179 
182 
185 };
186 }
187 #endif /* HAVE_LAPACK */
188 #endif
void set_max_iter(int32_t max_iter)
virtual bool train_machine(CFeatures *data=NULL)
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:43
L2 regularized support vector regression with L1 epsilon tube loss.
void set_liblinear_regression_type(LIBLINEAR_REGRESSION_TYPE st)
Features that support dot products among other operations.
Definition: DotFeatures.h:44
L2 regularized support vector regression with L2 epsilon tube loss.
L2 regularized support vector regression with L2 epsilon tube loss (dual)
LIBLINEAR_REGRESSION_TYPE get_liblinear_regression_type()
#define ASSERT(x)
Definition: SGIO.h:201
#define MACHINE_PROBLEM_TYPE(PT)
Definition: Machine.h:120
double float64_t
Definition: common.h:50
void set_tube_epsilon(float64_t eps)
Class LinearMachine is a generic interface for all kinds of linear machines like classifiers.
Definition: LinearMachine.h:63
LIBLINEAR_REGRESSION_TYPE m_liblinear_regression_type
CDotFeatures * features
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
This class provides an interface to the LibLinear library for large- scale linear learning focusing o...
void set_epsilon(float64_t epsilon)
virtual const char * get_name() const

SHOGUN Machine Learning Toolbox - Documentation