Before we build a KNN model for the HR attrition dataset, let us understand KNN's triple W.
k-Nearest Neighbors
What is k-Nearest Neighbors?
KNN is one of the most straightforward algorithms that stores all available data points and predicts new data based on distance similarity measures such as Euclidean distance. It is an algorithm that can make predictions using the training dataset directly. However, it is much more resource intensive as it doesn't have any training phase and requires all data present in memory to predict new instances.
Euclidean distance is calculated as the square root of the sum of the squared differences between two points.