Using kNN for predictive analytics

kNN is non-parametric and instance-based and is used in supervised learning. It is a robust and versatile classifier, frequently used as a benchmark for complex classifiers such as Neural Networks (NNs) and Support Vector Machines (SVMs). kNN is commonly used in economic forecasting, data compression, and genetics based on their expression profiling.

Working principles of kNN

The idea of kNN is that from a set of features x we try to predict the labels y. Thus, kNN falls in a supervised learning family of algorithms. Informally, this means that we are given a labeled dataset consisting of training observations (x, y). Now, the task is to model the relationship between x and y so that the function f: X→Y learns ...

Get Predictive Analytics with TensorFlow now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.