- 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.
- VMware View Security Essentials
- Node.js 10實戰(zhàn)
- Vue.js前端開發(fā)基礎(chǔ)與項目實戰(zhàn)
- HTML5+CSS3基礎(chǔ)開發(fā)教程(第2版)
- HTML5游戲開發(fā)案例教程
- C語言實驗指導(dǎo)及習(xí)題解析
- JavaScript 程序設(shè)計案例教程
- Getting Started with Greenplum for Big Data Analytics
- Visual FoxPro程序設(shè)計習(xí)題集及實驗指導(dǎo)(第四版)
- Go語言入門經(jīng)典
- Mapping with ArcGIS Pro
- ArcPy and ArcGIS(Second Edition)
- 亮劍C#項目開發(fā)案例導(dǎo)航
- VBA Automation for Excel 2019 Cookbook
- Clojure High Performance Programming