
color and size of a fruit, how do you determine whether it is orange or grapefruit?
We can use k-nearest neighbors algorithm for classifcation. You can classify by looking at its closest neighbors.

In this example, color and size are the features.
Cosine similarity solves this problem by comparing the angles of the two vectors, instead of measuring the distance between them.Naive Bayes classifier.