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.

相关文章
|
2月前
|
设计模式 消息中间件 前端开发
Java 设计模式之中介者模式:解耦复杂交互的架构艺术(含 UML 图解)
中介者模式通过引入协调者解耦多个对象间的复杂交互,将网状依赖转化为星型结构。适用于聊天室、GUI事件系统等场景,提升可维护性与扩展性,但需防中介者过度膨胀。
281 3
|
存储 Java
JAVA字符串与其他类型数据的转换
JAVA字符串与其他类型数据的转换
456 4
|
3月前
|
机器学习/深度学习 存储 资源调度
Transformer架构的简要解析
Transformer架构自2017年提出以来,彻底革新了人工智能领域,广泛应用于自然语言处理、语音识别等任务。其核心创新在于自注意力机制,通过计算序列中任意两个位置的相关性,打破了传统循环神经网络的序列依赖限制,实现了高效并行化与长距离依赖建模。该架构由编码器和解码器组成,结合多头注意力、位置编码、前馈网络等模块,大幅提升了模型表达能力与训练效率。从BERT到GPT系列,几乎所有现代大语言模型均基于Transformer构建,成为深度学习时代的关键技术突破之一。
623 7
|
机器学习/深度学习 人工智能 算法
基于YOLOv8的钢铁缺陷实时检测系统【训练和系统源码+Pyside6+数据集+包运行】
基于YOLOv8的钢铁缺陷实时检测系统,通过1800张图片训练,开发了带GUI界面的检测系统,支持图片、视频和摄像头实时检测,提高生产效率和产品质量。系统基于Python和Pyside6开发,具备模型权重导入、检测置信度调节等功能。项目代码、数据集可通过特定链接获取。
447 1
基于YOLOv8的钢铁缺陷实时检测系统【训练和系统源码+Pyside6+数据集+包运行】
|
监控 前端开发 数据可视化
深入调查研究
【11月更文挑战第5天】
265 2
|
机器学习/深度学习 数据可视化 算法
机器学习中的回归分析:理论与实践
机器学习中的回归分析:理论与实践
|
编解码 Android开发 UED
安卓UI/UX设计原则:打造引人入胜的用户体验
【4月更文挑战第13天】本文探讨了安卓UI/UX设计的关键原则,包括一致性、简洁性、反馈、清晰性、效率和适应性。一致性要求视觉和行为保持一致,利用系统UI;简洁性减少用户行动,简化导航;反馈需即时且明确;清晰性强调表达清晰,布局有序;效率关注性能优化和任务简化;适应性涉及多设备适配和用户多样性。遵循这些原则,可创建出色应用,提供无缝用户体验。设计应持续迭代,适应技术发展和用户需求。
564 6
|
Android开发 开发者
什么是Android Jetpack,它包括哪些组件?
【4月更文挑战第17天】Android Jetpack是Google提供的一套工具集,助力开发者高效、稳定地开发Android应用。它包含架构、UI、行为和基础组件,简化了后台任务、导航和生命周期管理,使开发者能专注于创新。随着不断更新,如CameraX的推出,掌握Jetpack对开发者面试和工作至关重要。
327 0
|
搜索推荐 程序员
IT圈的“鄙视链”:探讨技术领域的互相嫌弃文化
IT圈的“鄙视链”:探讨技术领域的互相嫌弃文化