公有成员 | 保护属性

CLDA类参考


详细描述

Class LDA implements regularized Linear Discriminant Analysis.

LDA learns a linear classifier and requires examples to be CSimpleFeatures. The learned linear classification rule is optimal under the assumption that both classes a gaussian distributed with equal co-variance. To find a linear separation ${\bf w}$ in training, the in-between class variance is maximized and the within class variance is minimized, i.e.

\[ J({\bf w})=\frac{{\bf w^T} S_B {\bf w}}{{\bf w^T} S_W {\bf w}} \]

is maximized, where

\[S_b := ({\bf m_{+1}} - {\bf m_{-1}})({\bf m_{+1}} - {\bf m_{-1}})^T \]

is the between class scatter matrix and

\[S_w := \sum_{c\in\{-1,+1\}}\sum_{{\bf x}\in X_{c}}({\bf x} - {\bf m_c})({\bf x} - {\bf m_c})^T \]

is the within class scatter matrix with mean ${\bf m_c} := \frac{1}{N}\sum_{j=1}^N {\bf x_j^c}$ and $X_c:=\{x_1^c, \dots, x_N^c\}$ the set of examples of class c.

LDA is very fast for low-dimensional samples. The regularization parameter $\gamma$ (especially useful in the low sample case) should be tuned in cross-validation.

参见:
CLinearClassifier
http://en.wikipedia.org/wiki/Linear_discriminant_analysis

在文件LDA.h52行定义。

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

所有成员的列表。

公有成员

 CLDA (float64_t gamma=0)
 CLDA (float64_t gamma, CSimpleFeatures< float64_t > *traindat, CLabels *trainlab)
virtual ~CLDA ()
void set_gamma (float64_t gamma)
float64_t get_gamma ()
virtual bool train (CFeatures *data=NULL)
virtual EClassifierType get_classifier_type ()
virtual void set_features (CDotFeatures *feat)
virtual const char * get_name () const

保护属性

float64_t m_gamma

构造及析构函数文档

CLDA ( float64_t  gamma = 0 )

constructor

参数:
gammagamma

在文件LDA.cpp23行定义。

CLDA ( float64_t  gamma,
CSimpleFeatures< float64_t > *  traindat,
CLabels trainlab 
)

constructor

参数:
gammagamma
traindattraining features
trainlablabels for training features

在文件LDA.cpp28行定义。

~CLDA (  ) [virtual]

在文件LDA.cpp36行定义。


成员函数文档

virtual EClassifierType get_classifier_type (  ) [virtual]

get classifier type

返回:
classifier type LDA

重载CClassifier

在文件LDA.h102行定义。

float64_t get_gamma (  )

get gamma

返回:
gamma

在文件LDA.h83行定义。

virtual const char* get_name (  ) const [virtual]
返回:
object name

实现了CSGObject

在文件LDA.h121行定义。

virtual void set_features ( CDotFeatures feat ) [virtual]

set features

参数:
featfeatures to set

重载CLinearClassifier

在文件LDA.h111行定义。

void set_gamma ( float64_t  gamma )

set gamme

参数:
gammathe new gamma

在文件LDA.h74行定义。

bool train ( CFeatures data = NULL ) [virtual]

train LDA classifier

参数:
datatraining data (parameter can be avoided if distance or kernel-based classifiers are used and distance/kernels are initialized with train data)
返回:
whether training was successful

重载CClassifier

在文件LDA.cpp40行定义。


成员数据文档

float64_t m_gamma [protected]

gamma

在文件LDA.h125行定义。


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

SHOGUN Machine Learning Toolbox - Documentation