- Machine Learning for OpenCV
- Michael Beyeler
- 174字
- 2021-07-02 19:47:22
Understanding the k-NN algorithm
The k-NN algorithm is arguably one of the simplest machine learning algorithms. The reason for this is that we basically only need to store the training dataset. Then, in order to make a prediction for a new data point, we only need to find the closest data point in the training dataset-its nearest neighbor.
In a nutshell, the k-NN algorithm argues that a data point probably belongs to the same class as its neighbors. Think about it: if our neighbor is a Reds fan, we're probably Reds fans, too; otherwise we would have moved away a long time ago. The same can be said for the Blues.
Of course, some neighborhoods might be a little more complicated. In this case, we would not just consider our closest neighbor (where k=1), but instead our k nearest neighbors. To stick with our example as mentioned earlier, if we were Reds fans, we probably wouldn't move into a neighborhood where the majority of people are Blues fans.
That's all there is to it.
- Learning Spring 5.0
- Learning RxJava
- PHP+MySQL網(wǎng)站開發(fā)技術項目式教程(第2版)
- Visual C
- Python數(shù)據(jù)挖掘與機器學習實戰(zhàn)
- Arduino家居安全系統(tǒng)構(gòu)建實戰(zhàn)
- Go語言精進之路:從新手到高手的編程思想、方法和技巧(1)
- Getting Started with Eclipse Juno
- OpenCV 3計算機視覺:Python語言實現(xiàn)(原書第2版)
- C++17 By Example
- IBM RUP參考與認證指南
- Distributed Computing with Python
- Raspberry Pi開發(fā)實戰(zhàn)
- Leaflet.js Essentials
- Scratch 3.0少兒游戲趣味編程