SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
LinearMachine.h
浏览该文件的文档.
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
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:44
A generic learning machine interface.
Definition: Machine.h:143
virtual float64_t apply_one(int32_t vec_idx)
double float64_t
Definition: common.h:50
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:63
virtual void store_model_features()
virtual SGVector< float64_t > get_w() const
CDotFeatures * features
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
virtual float64_t get_bias()
Binary Labels for binary classification.
Definition: BinaryLabels.h:37
virtual void set_bias(float64_t b)

SHOGUN 机器学习工具包 - 项目文档