SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
LinearMachine.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) 1999-2009 Soeren Sonnenburg
8  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef _LINEARCLASSIFIER_H__
12 #define _LINEARCLASSIFIER_H__
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/lib/common.h>
17 #include <shogun/machine/Machine.h>
18 #include <shogun/lib/SGVector.h>
19 
20 
21 namespace shogun
22 {
23 
24 class CBinaryLabels;
25 class CDotFeatures;
26 class CFeatures;
27 class CRegressionLabels;
28 
63 class CLinearMachine : public CMachine
64 {
65  public:
68 
70  virtual ~CLinearMachine();
71 
74 
79  virtual SGVector<float64_t> get_w() const;
80 
85  virtual void set_w(const SGVector<float64_t> src_w);
86 
91  virtual void set_bias(float64_t b);
92 
97  virtual float64_t get_bias();
98 
103  virtual void set_features(CDotFeatures* feat);
104 
111  virtual CBinaryLabels* apply_binary(CFeatures* data=NULL);
112 
119  virtual CRegressionLabels* apply_regression(CFeatures* data=NULL);
120 
122  virtual float64_t apply_one(int32_t vec_idx);
123 
128  virtual CDotFeatures* get_features();
129 
135  virtual const char* get_name() const { return "LinearMachine"; }
136 
137  protected:
138 
145 
150  virtual void store_model_features();
151 
152  private:
153 
154  void init();
155 
156  protected:
163 };
164 }
165 #endif

SHOGUN Machine Learning Toolbox - Documentation