Fisher判别分析简述

简介: Supervised Dimension ReductionGreater dimensionality always brings about more difficult learning tasks. Here we introduce a supervised dimension reduction method based on linear dimension

Supervised Dimension Reduction

Greater dimensionality always brings about more difficult learning tasks. Here we introduce a supervised dimension reduction method based on linear dimension reduction as introduced in

http://blog.csdn.net/philthinker/article/details/70212147

which can also be simplified as:

z=Tx,xRd,zRm,m<d

Of course, centeralization in the first place is necessary:
xixi1ni=1nxi

Fisher discrimination analysis is one of the most basic supervised linear dimension reduction methods, where we seek for a T to make samples of the same label as close as possible and vice versa. To begin with, define within-class class matrix S(w) and between-class matrix S(b) as:

S(w)=y=1ci:yi=y(xiμy)(xiμy)TR(d×d)S(b)=y=1cnyμyμTyR(d×d)

where
μy=1nyi:yi=yxi

i:yi=y stands for the sum of y satisfying yi=y , ny is the amount of samples belonging to class y .
Then we can define the projection matrix T :
maxTRm×dtr((TS(w)TT)1TS(b)TT)

It is obvious that our optimization goal is trying to maximize within-class matrix TS(w)TT as well as minimize between-class matrix TS(b)TT .
This optimization problem is solvable once we carry out some approaches similar to the one used in Unsupervised Dimension Reduction, i.e.
S(b)ξ=λS(w)ξ

where the normalized eigenvalues are λ1λd0 and corresponded eigen-vectors are ξ1,,ξd . Taking the largest m eigenvalues we get the solution of T :
Tˆ=(ξ1,,ξm)T
n=100; x=randn(n,2);
x(1:n/2,1)=x(1:n/2,1)-4;
x(n/2+1:end,1)=x(n/2+1:end, 1)+4;
x=x-repmat(mean(x),[n,1]);
y=[ones(n/2,1);2*ones(n/2,1)];

m1=mean(x(y==1,:));
x1=x(y==1,:)-repmat(m1,[n/2,1]);
m2=mean(x(y==2,:));
x2=x(y==2,:)-repmat(m2,[n/2,1]);
[t,v]=eigs(n/2*(m1')*m1+n/2*(m2')*m2,x1'*x1+x2'*x2,1);

figure(1); clf; hold on; axis([-8 8 -6 6]);
plot(x(y==1,1),x(y==1,2),'bo');
plot(x(y==2,1),x(y==2,2),'rx');
plot(99*[-t(1) t(1)],99*[-t(2) t(2)],'k-');

Fisher

Attention please: when samples have several peeks, the output fails to be ideal. Local Fisher Discrimination Analysis may work yet.

相关文章
|
设计模式 前端开发 Java
Entity-Boundary-Interactor(EBI)介绍
Entity-Boundary-Interactor(EBI)介绍
370 0
|
安全 Java 程序员
C++ 异常
C++ 异常
93 0
|
算法 Java
JVM性能优化(二)垃圾回收算法详解(2)
JVM性能优化(二)垃圾回收算法详解
233 0
JVM性能优化(二)垃圾回收算法详解(2)
|
存储 SQL 关系型数据库
mysql索引(六)主键索引
主键索引(PRIMARY):它是一种特殊的唯一索引,不允许有空值。 主键索引,简称主键,原文是PRIMARY KEY,由一个或多个列组成,用于唯一性标识数据表中的某一条记录。一个表可以没有主键,但最多只能有一个主键,并且主键值不能包含NULL。
1538 0
mysql索引(六)主键索引
|
存储 安全 Java
单点登录的原理
单点登录的原理
535 0
单点登录的原理
|
传感器 安全 机器人
无人机"超脑"争夺战一触即发!
锤子新品发布会上,罗永浩向外界透露了“下一代计算平台”。由 PC 到手机,人类计算平台完成了移动化和小型化的进化;由手机到智能硬件,这个百亿量级的大计算平台将使人类进入物联网时代。
291 0
无人机"超脑"争夺战一触即发!
|
网络协议 Unix 应用服务中间件
Gitlab安装配置及简单问题处理
Gitlab安装配置及简单问题处理
287 0
|
数据库
「OushuDB」版本升级 升级脚本使用说明
请注意留下足够的升级与测试时间,避免升级出现问题需要回退到老版本。另外,请在升级前做好元数据的备份工作,防止出现意外。
182 0
|
监控 Kubernetes Go
用 Go 搭建 Kubernetes Operators
简介 Istio 是一个由 IBM、Google 以及 Lyft 联合推出的开源软件,以无痛方式为运行在 Kubernetes 上的微服务提供流量管理,访问策略管理以及监控等功能。这一软件目前仅在 Kubernetes 上运行,今后可能会扩展到其他平台。
1611 0