SHOGUN  v2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DirectorLinearMachine.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 Evgeniy Andreev (gsomix)
8  */
9 
10 #ifndef _DIRECTORLINEARMACHINE_H___
11 #define _DIRECTORLINEARMACHINE_H___
12 
13 #ifdef USE_SWIG_DIRECTORS
14 #include <shogun/lib/common.h>
15 #include <shogun/lib/DataType.h>
16 #include <shogun/machine/Machine.h>
18 
19 namespace shogun
20 {
21 
22 #define IGNORE_IN_CLASSLIST
23 IGNORE_IN_CLASSLIST class CDirectorLinearMachine : public CLinearMachine
24 {
25  public:
26  /* default constructor */
27  CDirectorLinearMachine()
28  : CLinearMachine()
29  {
30 
31  }
32 
33  /* destructor */
34  virtual ~CDirectorLinearMachine()
35  {
36 
37  }
38 
48  virtual bool train(CFeatures* data=NULL)
49  {
50  return CLinearMachine::train(data);
51  }
52 
53  virtual bool train_function(CFeatures* data=NULL)
54  {
55  SG_ERROR("Train function of Director Linear Machine needs to be overridden.\n");
56  return false;
57  }
58 
63  virtual inline void set_features(CDotFeatures* feat)
64  {
66  }
67 
72  virtual CDotFeatures* get_features()
73  {
75  }
76 
83  virtual CLabels* apply(CFeatures* data=NULL)
84  {
85  return CLinearMachine::apply(data);
86  }
87 
89  virtual CBinaryLabels* apply_binary(CFeatures* data=NULL)
90  {
91  return CLinearMachine::apply_binary(data);
92  }
93 
95  virtual CRegressionLabels* apply_regression(CFeatures* data=NULL)
96  {
98  }
99 
102 
103  virtual float64_t apply_one(int32_t vec_idx)
104  {
105  return CLinearMachine::apply_one(vec_idx);
106  }
107 
112  virtual void set_labels(CLabels* lab)
113  {
115  }
116 
121  virtual CLabels* get_labels()
122  {
124  }
125 
130  virtual EMachineType get_classifier_type() { return CT_DIRECTORLINEAR; }
131 
137  virtual void set_store_model_features(bool store_model)
138  {
140  }
141 
150  virtual bool train_locked(SGVector<index_t> indices)
151  {
152  return CLinearMachine::train_locked(indices);
153  }
154 
160  virtual CLabels* apply_locked(SGVector<index_t> indices)
161  {
162  return CLinearMachine::apply_locked(indices);
163  }
164 
165  virtual CBinaryLabels* apply_locked_binary(SGVector<index_t> indices)
166  {
167  return CLinearMachine::apply_locked_binary(indices);
168  }
169 
170  virtual CRegressionLabels* apply_locked_regression(
171  SGVector<index_t> indices)
172  {
174  }
175 
177 
186  virtual void data_lock(CLabels* labs, CFeatures* features)
187  {
188  CLinearMachine::data_lock(labs, features);
189  }
190 
192  virtual void data_unlock()
193  {
195  }
196 
198  virtual bool supports_locking() const
199  {
201  }
202 
203  //TODO change to pure virtual
204  inline virtual EProblemType get_machine_problem_type() const
205  {
207  }
208 
209  virtual const char* get_name() const { return "DirectorLinearMachine"; }
210 
211  protected:
222  virtual bool train_machine(CFeatures* data=NULL)
223  {
224  return train_function(data);
225  }
226 };
227 
228 }
229 
230 #endif /* USE_SWIG_DIRECTORS */
231 #endif /* _DIRECTORLINEARMACHINE_H___ */

SHOGUN Machine Learning Toolbox - Documentation