Skip to content

Commit

Permalink
update for knn
Browse files Browse the repository at this point in the history
  • Loading branch information
llinjupt committed Apr 19, 2019
1 parent 03056b5 commit 24f1fd3
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
Binary file added imgs/practice/d100.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/practice/d1000.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added imgs/practice/d10000.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 24 additions & 1 deletion practice.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,30 @@ mnist 数据集上的试验
很容易看出来,1 与 其他数字的距离都比较远,离其他 1 距离较近。此时不难想出一个简单的数字分类算法:在样本上计算距离,找出最近的几个样本,查看它们的标签,最多标签标示的数字的就是最可能的数字。
注意:此时的计算机无法识别大角度旋转甚至倒立的数字,这需要数据的预处理。
注意:此时的计算机无法识别大角度旋转甚至倒立的数字,这需要数据的预处理。数字图像叠加然后取平均,就是高维空间中的中心投影,显然使用训练数据越多,这个投影越能表示数字的特征:
.. figure:: imgs/practice/d100.png
:scale: 100%
:align: center
:alt: Monroe
前100个训练集数据叠加影像
.. figure:: imgs/practice/d1000.png
:scale: 100%
:align: center
:alt: Monroe
前1000个训练集数据叠加影像
在前 10000 个训练数据集上进行数字叠加的效果已经相当完美,更多的采用已经无法提高数字的核心特征。
.. figure:: imgs/practice/d10000.png
:scale: 100%
:align: center
:alt: Monroe
前10000个训练集数据叠加影像
kNN 邻近算法
`````````````
Expand Down

0 comments on commit 24f1fd3

Please sign in to comment.