公有成员 | 保护属性

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.h60行定义。

继承图,类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 CLabelsclassify ()
virtual CLabelsclassify (CFeatures *data)
virtual CDotFeaturesget_features ()

保护属性

int32_t w_dim
float64_tw
float64_t bias
CDotFeaturesfeatures

构造及析构函数文档

default constructor

在文件LinearClassifier.cpp15行定义。

~CLinearClassifier (  ) [virtual]

在文件LinearClassifier.cpp20行定义。


成员函数文档

CLabels * classify (  ) [virtual]

classify all examples

返回:
resulting labels

实现了CClassifier

在文件LinearClassifier.cpp36行定义。

CLabels * classify ( CFeatures data ) [virtual]

classify objects

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

实现了CClassifier

在文件LinearClassifier.cpp58行定义。

virtual float64_t classify_example ( int32_t  vec_idx ) [virtual]

get output for example "vec_idx"

重载CClassifier

在文件LinearClassifier.h68行定义。

float64_t get_bias (  )

get bias

返回:
bias

在文件LinearClassifier.h126行定义。

virtual CDotFeatures* get_features (  ) [virtual]

get features

返回:
features

在文件LinearClassifier.h173行定义。

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

get w

参数:
dst_wstore w in this argument
dst_dimsdimension of w

在文件LinearClassifier.h78行定义。

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.h90行定义。

bool load ( FILE *  srcfile ) [virtual]

load from file

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

重载CClassifier

在文件LinearClassifier.cpp26行定义。

bool save ( FILE *  dstfile ) [virtual]

save to file

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

重载CClassifier

在文件LinearClassifier.cpp31行定义。

void set_bias ( float64_t  b )

set bias

参数:
bnew bias

在文件LinearClassifier.h117行定义。

virtual void set_features ( CDotFeatures feat ) [virtual]

set features

参数:
featfeatures to set

CLDACLPBoostCLPM重载。

在文件LinearClassifier.h149行定义。

void set_w ( float64_t src_w,
int32_t  src_w_dim 
)

set w

参数:
src_wnew w
src_w_dimdimension of new w

在文件LinearClassifier.h105行定义。


成员数据文档

float64_t bias [protected]

bias

在文件LinearClassifier.h181行定义。

CDotFeatures* features [protected]

features

在文件LinearClassifier.h183行定义。

float64_t* w [protected]

w

在文件LinearClassifier.h179行定义。

int32_t w_dim [protected]

dimension of w

在文件LinearClassifier.h177行定义。


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

SHOGUN Machine Learning Toolbox - Documentation