SHOGUN  v3.2.0
 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/common.h>
15 #include <shogun/labels/Labels.h>
17 #include <shogun/machine/Machine.h>
18 
19 #include <stdio.h>
20 
21 namespace shogun
22 {
23  class CDotFeatures;
24  class CMachine;
25  class CLabels;
26 
61 class CLinearMachine : public CMachine
62 {
63  public:
66 
68  virtual ~CLinearMachine();
69 
72 
77  virtual SGVector<float64_t> get_w() const;
78 
83  virtual void set_w(const SGVector<float64_t> src_w);
84 
89  virtual void set_bias(float64_t b);
90 
95  virtual float64_t get_bias();
96 
101  virtual void set_features(CDotFeatures* feat);
102 
109  virtual CBinaryLabels* apply_binary(CFeatures* data=NULL);
110 
117  virtual CRegressionLabels* apply_regression(CFeatures* data=NULL);
118 
120  virtual float64_t apply_one(int32_t vec_idx);
121 
126  virtual CDotFeatures* get_features();
127 
133  virtual const char* get_name() const { return "LinearMachine"; }
134 
135  protected:
136 
143 
148  virtual void store_model_features();
149 
150  private:
151 
152  void init();
153 
154  protected:
161 };
162 }
163 #endif
virtual CBinaryLabels * apply_binary(CFeatures *data=NULL)
virtual SGVector< float64_t > apply_get_outputs(CFeatures *data)
Real Labels are real-valued labels.
virtual CRegressionLabels * apply_regression(CFeatures *data=NULL)
virtual void set_w(const SGVector< float64_t > src_w)
virtual CDotFeatures * get_features()
Features that support dot products among other operations.
Definition: DotFeatures.h:41
A generic learning machine interface.
Definition: Machine.h:138
virtual float64_t apply_one(int32_t vec_idx)
double float64_t
Definition: common.h:48
virtual const char * get_name() const
SGVector< float64_t > w
virtual void set_features(CDotFeatures *feat)
Class LinearMachine is a generic interface for all kinds of linear machines like classifiers.
Definition: LinearMachine.h:61
virtual void store_model_features()
virtual SGVector< float64_t > get_w() const
CDotFeatures * features
The class Features is the base class of all feature objects.
Definition: Features.h:62
virtual float64_t get_bias()
Binary Labels for binary classification.
Definition: BinaryLabels.h:36
virtual void set_bias(float64_t b)

SHOGUN Machine Learning Toolbox - Documentation