SHOGUN  3.2.1
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
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 #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
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:139
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:64
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:68
virtual float64_t get_bias()
Binary Labels for binary classification.
Definition: BinaryLabels.h:37
virtual void set_bias(float64_t b)

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