SHOGUN  3.2.1
 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 
14 #include <shogun/lib/config.h>
15 #include <shogun/lib/common.h>
19 
20 namespace shogun
21 {
22 
38 {
39  public:
41 
42 
44 
51 
53  virtual ~CMulticlassLibLinear();
54 
56  virtual const char* get_name() const
57  {
58  return "MulticlassLibLinear";
59  }
60 
64  inline void set_C(float64_t C)
65  {
66  ASSERT(C>0)
67  m_C = C;
68  }
72  inline float64_t get_C() const { return m_C; }
73 
78  {
79  ASSERT(epsilon>0)
81  }
85  inline float64_t get_epsilon() const { return m_epsilon; }
86 
90  inline void set_use_bias(bool use_bias)
91  {
92  m_use_bias = use_bias;
93  }
97  inline bool get_use_bias() const
98  {
99  return m_use_bias;
100  }
101 
105  inline void set_save_train_state(bool save_train_state)
106  {
107  m_save_train_state = save_train_state;
108  }
112  inline bool get_save_train_state() const
113  {
114  return m_save_train_state;
115  }
116 
120  inline void set_max_iter(int32_t max_iter)
121  {
122  ASSERT(max_iter>0)
123  m_max_iter = max_iter;
124  }
128  inline int32_t get_max_iter() const { return m_max_iter; }
129 
132  {
133  if (m_train_state)
134  {
135  delete m_train_state;
136  m_train_state = NULL;
137  }
138  }
139 
144 
145 protected:
146 
148  virtual bool train_machine(CFeatures* data = NULL);
149 
152 
153 private:
154 
156  void init_defaults();
157 
159  void register_parameters();
160 
161 protected:
162 
165 
168 
170  int32_t m_max_iter;
171 
174 
177 
179  mcsvm_state* m_train_state;
180 };
181 }
182 #endif

SHOGUN Machine Learning Toolbox - Documentation