6Distance-Based Models

6.1 Introduction

A machine learning approach called nearest neighbor classification seeks to identify previously unknown query items while differentiating two or more destination classes [1]. It discovers the nearest neighbor to an unknown pattern and gives the class name of this nearest neighbor to the unknown pattern [2]. A simple expansion of number of navigational contexts (NNC) is to consider the k-closest neighbors, with the class label determined by a majority vote [3].

As an example, consider a dataset consisting three features and a class label as shown in Table 6.1 with 10 objects in the dataset. The unknown object, Q(1.75, 1.75, 1.75), class label is identified by computing Euclidean distance of the unknown object to 10 objects. The computed Euclidean distance is shown in Table 6.2. The unknown object class label is class label of the object with least distance, i.e., the class label of Q is 1. The rule used here is known as NNC or 1-NNC because only one nearest neighbor is taken for classification. One can consider more than one neighbor called as k-NN classification model, where k is a positive integer [4, 5].

K-nearest neighbor is a strong and simple machine learning classification algorithm. This supervised learning approach has a wide range of applications, including pattern recognition, data mining, and prediction analysis. It is widely utilized in real-world situations because it is non-parametric, which means it does not make any assumptions ...

Get Machine Learning for Industrial Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.