SHOGUN  v3.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MulticlassLibLinear.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) 2012 Sergey Lisitsyn
8  * Copyright (C) 2012 Sergey Lisitsyn
9  */
10 
11 #ifndef _MULTICLASSLIBLINEAR_H___
12 #define _MULTICLASSLIBLINEAR_H___
13 #include <shogun/lib/config.h>
14 #include <shogun/lib/common.h>
18 
19 namespace shogun
20 {
21 
37 {
38  public:
40 
41 
43 
50 
52  virtual ~CMulticlassLibLinear();
53 
55  virtual const char* get_name() const
56  {
57  return "MulticlassLibLinear";
58  }
59 
63  inline void set_C(float64_t C)
64  {
65  ASSERT(C>0)
66  m_C = C;
67  }
71  inline float64_t get_C() const { return m_C; }
72 
77  {
78  ASSERT(epsilon>0)
80  }
84  inline float64_t get_epsilon() const { return m_epsilon; }
85 
89  inline void set_use_bias(bool use_bias)
90  {
91  m_use_bias = use_bias;
92  }
96  inline bool get_use_bias() const
97  {
98  return m_use_bias;
99  }
100 
104  inline void set_save_train_state(bool save_train_state)
105  {
106  m_save_train_state = save_train_state;
107  }
111  inline bool get_save_train_state() const
112  {
113  return m_save_train_state;
114  }
115 
119  inline void set_max_iter(int32_t max_iter)
120  {
121  ASSERT(max_iter>0)
122  m_max_iter = max_iter;
123  }
127  inline int32_t get_max_iter() const { return m_max_iter; }
128 
131  {
132  if (m_train_state)
133  {
134  delete m_train_state;
135  m_train_state = NULL;
136  }
137  }
138 
143 
144 protected:
145 
147  virtual bool train_machine(CFeatures* data = NULL);
148 
151 
152 private:
153 
155  void init_defaults();
156 
158  void register_parameters();
159 
160 protected:
161 
164 
167 
169  int32_t m_max_iter;
170 
173 
176 
178  mcsvm_state* m_train_state;
179 };
180 }
181 #endif

SHOGUN Machine Learning Toolbox - Documentation