Instance Based Learning
Instance Based Learning
The image shows how KNN predicts the category of a new data point based on its closest
neighbours.
The red diamonds represent Category 1 and the blue squares represent Category 2.
The new data point checks its closest neighbours (circled points).
Since the majority of its closest neighbours are blue squares (Category 2) KNN predicts the
new data point belongs to Category 2.
What is ‘K’ in K Nearest Neighbour ?
2. Manhattan Distance
• This is the total distance you would travel if you could only move along
horizontal and vertical lines (like a grid or city streets). It’s also called
“taxicab distance” because a taxi can only drive along the grid-like streets
of a city.
• 3. Minkowski Distance
Minkowski distance is like a family of distances, which includes
both Euclidean and Manhattan distances as special cases.
Working of KNN algorithm
Output:
A