Join our book community on Discord

https://packt.link/EarlyAccessCommunity
As human beings, it’s relatively easy for us to distinguish objects that are both similar and dissimilar to one another. For example, even a young child could tell you that a Toyota and say, a cheetah are not the same thing…not even close (although they might both be capable of moving fast)! However, a cheetah and a puma do share many common characteristics, both being quadrupedal animals with tails, claws, and so on. So, if shown an image of a Toyota and asked if it was a car or a cat, our same young child would probably have no problem categorizing it as a car. This type of comparison forms the basis of some of the simplest methods for classification in machine learning (ML) and allows us to classify new objects based on their similarity to known objects already classified.
This chapter discusses models based on distance metrics, such as k-nearest neighbors (KNN), covering theory, implementation...