Strategies for removing noisy observations
The king might decide to look at the friendships and locations of the citizens before removing anyone. The king might decide to remove the Capulets who are rich and live near the Montagues. This could bring peace to the city by separating the feuding clans. Let’s look at some strategies to do that with our data.
ENN, RENN, and AllKNN
The king can remove the Capulets based on their neighbors. For example, if one or more of the three closest neighbors of a Capulet is a Montague, the king can remove the Capulet. This technique is called Edited Nearest Neighbors (ENN) [5]. ENN removes the examples near the decision boundary to increase the separation between classes. We fit a KNN to the whole dataset and remove the examples whose neighbors don’t belong to the same class. The imbalanced-learn
library gives us options to decide which classes we would like to resample and what kind of class arrangement the neighbors of the sample...