SHOGUN v0.9.0
公有成员 | 保护属性
CLinearClassifier类参考

详细描述

Class LinearClassifier is a generic interface for all kinds of linear classifiers.

A linear classifier computes

\[ f({\bf x})= {\bf w} \cdot {\bf x} + b \]

where ${\bf w}$ are the weights assigned to each feature in training and $b$ the bias.

To implement a linear classifier all that is required is to define the train() function that delivers ${\bf w}$ above.

Note that this framework works with linear classifiers of arbitraty feature type, e.g. dense and sparse and even string based features. This is implemented by using CDotFeatures that may provide a mapping function $\Phi({\bf x})\mapsto {\cal R^D}$ encapsulating all the required operations (like the dot product). The decision function is thus

\[ f({\bf x})= {\bf w} \cdot \Phi({\bf x}) + b. \]

The following linear classifiers are implemented

参见:
CDotFeatures

在文件LinearClassifier.h第60行定义。

继承图,类CLinearClassifier
Inheritance graph
[图例]

所有成员的列表。

公有成员

 CLinearClassifier ()
virtual ~CLinearClassifier ()
virtual float64_t classify_example (int32_t vec_idx)
 get output for example "vec_idx"
void get_w (float64_t *&dst_w, int32_t &dst_dims)
void get_w (float64_t **dst_w, int32_t *dst_dims)
void set_w (float64_t *src_w, int32_t src_w_dim)
void set_bias (float64_t b)
float64_t get_bias ()
virtual bool load (FILE *srcfile)
virtual bool save (FILE *dstfile)
virtual void set_features (CDotFeatures *feat)
virtual CLabels * classify ()
virtual CLabels * classify (CFeatures *data)
virtual CDotFeatures * get_features ()
virtual const char * get_name (void) const

保护属性

int32_t w_dim
float64_t * w
float64_t bias
CDotFeatures * features

构造及析构函数文档

default constructor

在文件LinearClassifier.cpp第16行定义。

~CLinearClassifier ( ) [virtual]

在文件LinearClassifier.cpp第26行定义。


成员函数文档

CLabels * classify ( ) [virtual]

classify all examples

返回:
resulting labels

实现了CClassifier。

在文件LinearClassifier.cpp第46行定义。

CLabels * classify ( CFeatures *  data) [virtual]

classify objects

参数:
data(test)data to be classified
返回:
classified labels

实现了CClassifier。

在文件LinearClassifier.cpp第68行定义。

virtual float64_t classify_example ( int32_t  vec_idx) [virtual]

get output for example "vec_idx"

重载CClassifier。

在文件LinearClassifier.h第68行定义。

float64_t get_bias ( )

get bias

返回:
bias

在文件LinearClassifier.h第126行定义。

virtual CDotFeatures* get_features ( ) [virtual]

get features

返回:
features

在文件LinearClassifier.h第173行定义。

virtual const char* get_name ( void  ) const [virtual]

Returns the name of the SGSerializable instance. It MUST BE the CLASS NAME without the prefixed `C'.

返回:
name of the SGSerializable

实现了CSGObject。

被CLDA、CLPBoost、CLPM、CPerceptron、CSubGradientLPM、CDomainAdaptationSVMLinear、CLibLinear、CSubGradientSVM、CSVMLin、CSVMOcas及CSVMSGD重载。

在文件LinearClassifier.h第180行定义。

void get_w ( float64_t **  dst_w,
int32_t *  dst_dims 
)

get w (swig compatible)

参数:
dst_wstore w in this argument
dst_dimsdimension of w

在文件LinearClassifier.h第90行定义。

void get_w ( float64_t *&  dst_w,
int32_t &  dst_dims 
)

get w

参数:
dst_wstore w in this argument
dst_dimsdimension of w

在文件LinearClassifier.h第78行定义。

bool load ( FILE *  srcfile) [virtual]

load from file

参数:
srcfilefile to load from
返回:
if loading was successful

重载CClassifier。

在文件LinearClassifier.cpp第32行定义。

bool save ( FILE *  dstfile) [virtual]

save to file

参数:
dstfilefile to save to
返回:
if saving was successful

重载CClassifier。

在文件LinearClassifier.cpp第39行定义。

void set_bias ( float64_t  b)

set bias

参数:
bnew bias

在文件LinearClassifier.h第117行定义。

virtual void set_features ( CDotFeatures *  feat) [virtual]

set features

参数:
featfeatures to set

被CLDA、CLPBoost及CLPM重载。

在文件LinearClassifier.h第149行定义。

void set_w ( float64_t *  src_w,
int32_t  src_w_dim 
)

set w

参数:
src_wnew w
src_w_dimdimension of new w

在文件LinearClassifier.h第105行定义。


成员数据文档

float64_t bias [protected]

bias

在文件LinearClassifier.h第189行定义。

CDotFeatures* features [protected]

features

在文件LinearClassifier.h第191行定义。

float64_t* w [protected]

w

在文件LinearClassifier.h第187行定义。

int32_t w_dim [protected]

dimension of w

在文件LinearClassifier.h第185行定义。


该类的文档由以下文件生成:

SHOGUN Machine Learning Toolbox - Documentation