一、KNN
确定训练样本,以及某种距离度量。
对于某个给定的测试样本,找到训练集中距离最近的k个样本,对于分类问题使用“投票法”获得预测结果,对于回归问题使用“平均法”获得预测结果。还可基于距离远近进行加权平均或加权投票,距离越近的样本权重越大。
当k取不同值时,分类结果会有显著不同。
若采用不同的距离计算方式,则找出的“近邻”可能有显著差别,从而也会导致分类结果有显著不同
![dd5a462848fb2f76a825a080bd66fc74.png](https://img-blog.csdnimg.cn/img_convert/dd5a462848fb2f76a825a080bd66fc74.png)
二、维数灾难
![22899e1f191c4cd4c5a338e90ecb2e6b.png](https://img-blog.csdnimg.cn/img_convert/22899e1f191c4cd4c5a338e90ecb2e6b.png)
一般情况下,如果使用现有特征获得的分类器性能不佳,则会考虑添加新的特征,以提高分类器性能(以运算复杂度为代价)。
![5e50e72e1f276b20e3eed6cfbaef5c85.png](https://img-blog.csdnimg.cn/img_convert/5e50e72e1f276b20e3eed6cfbaef5c85.png)
三、主成分分析(PCA)
![1f8db4c081d6b159afac5f97c53b7e5d.png](https://img-blog.csdnimg.cn/img_convert/1f8db4c081d6b159afac5f97c53b7e5d.png)
![f0133cfe0fe253e0103cefd164450774.png](https://img-blog.csdnimg.cn/img_convert/f0133cfe0fe253e0103cefd164450774.png)
![60eee748987dd2c054f8020c98c084d5.jpeg](https://img-blog.csdnimg.cn/img_convert/60eee748987dd2c054f8020c98c084d5.jpeg)
若 与
正交,则新坐标系是一个正交坐标系,此时 W为正交变换。
显然,新空间中的属性是原空间中的属性的线性组合。
-
推导:
![f25c539e348da22e4129a6a23491d67c.png](https://img-blog.csdnimg.cn/img_convert/f25c539e348da22e4129a6a23491d67c.png)
最大可分性:
样本点 在新空间中超平面上的投影是
,若所有样本点的投影能尽可能分开,则应该使得投影后样本点的方差
(已中心化)最大化。
最近重构性:
希望原样本点和基于投影重构的样本点的距离越小越好
![bad6943b3f2c7ec543c0afc9a37f94b6.png](https://img-blog.csdnimg.cn/img_convert/bad6943b3f2c7ec543c0afc9a37f94b6.png)
![9adee188c5990d2eb9c9e33c081edcab.jpeg](https://img-blog.csdnimg.cn/img_convert/9adee188c5990d2eb9c9e33c081edcab.jpeg)
![8e05cd9fbbc36ab9b689de366f760ca6.png](https://img-blog.csdnimg.cn/img_convert/8e05cd9fbbc36ab9b689de366f760ca6.png)
基于两种思想得到的最优化的式子是一致的。
求解:
![7f8b06a515a3096a53b6a6f326857482.png](https://img-blog.csdnimg.cn/img_convert/7f8b06a515a3096a53b6a6f326857482.png)
![1393f22124f18ab369b49fc678d5287d.png](https://img-blog.csdnimg.cn/img_convert/1393f22124f18ab369b49fc678d5287d.png)
-
PCA算法流程
![c23acecaa49512c9aa1170a7a72af46c.png](https://img-blog.csdnimg.cn/img_convert/c23acecaa49512c9aa1170a7a72af46c.png)
![b3080af1fd2a6ce9c61acf12b0c5013f.png](https://img-blog.csdnimg.cn/img_convert/b3080af1fd2a6ce9c61acf12b0c5013f.png)
KPCA:
![328824a767e50053722309dafdb71af3.jpeg](https://img-blog.csdnimg.cn/img_convert/328824a767e50053722309dafdb71af3.jpeg)
![1e1508d526283b45e85043602f312d6d.png](https://img-blog.csdnimg.cn/img_convert/1e1508d526283b45e85043602f312d6d.png)
伪代码:
![986a8acda89e256d73429d44918b9a24.jpeg](https://img-blog.csdnimg.cn/img_convert/986a8acda89e256d73429d44918b9a24.jpeg)
四、流形学习
用于从高维采样数据恢复低维流形结构,是一种非线性降维方法。
把数据从高维空间,保持一定几何拓扑关系,如测地距离/邻域线性重构关系,进行非线性降维,映射到低维嵌入空间。
![dcff8eb0101ae2975ab4b0fc32033c59.png](https://img-blog.csdnimg.cn/img_convert/dcff8eb0101ae2975ab4b0fc32033c59.png)
Isomap:
![7870adedcb1e98d4f81dd56f5fece39c.png](https://img-blog.csdnimg.cn/img_convert/7870adedcb1e98d4f81dd56f5fece39c.png)
![82b21a59b9f61b381287a6115940ec81.png](https://img-blog.csdnimg.cn/img_convert/82b21a59b9f61b381287a6115940ec81.png)
局部线性嵌入LLE:
局部线性嵌入试图保持邻域内的线性关系,并使得该线性关系在降维后的空间中继续保持。
五、度量学习
![32c3ec47fba561a93b7aebcba9a7ca39.png](https://img-blog.csdnimg.cn/img_convert/32c3ec47fba561a93b7aebcba9a7ca39.png)
![233da7b3b2efa871b55b9e42505916b7.png](https://img-blog.csdnimg.cn/img_convert/233da7b3b2efa871b55b9e42505916b7.png)
![833b3628b75ce7987e02055934a491ed.png](https://img-blog.csdnimg.cn/img_convert/833b3628b75ce7987e02055934a491ed.png)