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 #include <stdio.h>
21 
22 namespace shogun
23 {
24 
25 class CBinaryLabels;
26 class CDotFeatures;
27 class CFeatures;
28 class CRegressionLabels;
29 
64 class CLinearMachine : public CMachine
65 {
66  public:
69 
71  virtual ~CLinearMachine();
72 
75 
80  virtual SGVector<float64_t> get_w() const;
81 
86  virtual void set_w(const SGVector<float64_t> src_w);
87 
92  virtual void set_bias(float64_t b);
93 
98  virtual float64_t get_bias();
99 
104  virtual void set_features(CDotFeatures* feat);
105 
112  virtual CBinaryLabels* apply_binary(CFeatures* data=NULL);
113 
120  virtual CRegressionLabels* apply_regression(CFeatures* data=NULL);
121 
123  virtual float64_t apply_one(int32_t vec_idx);
124 
129  virtual CDotFeatures* get_features();
130 
136  virtual const char* get_name() const { return "LinearMachine"; }
137 
138  protected:
139 
146 
151  virtual void store_model_features();
152 
153  private:
154 
155  void init();
156 
157  protected:
164 };
165 }
166 #endif

SHOGUN Machine Learning Toolbox - Documentation