Is it wrong to leverage a model to label data, then perform a train/test split to evaluate the performance of said model?
Assume I have an unlabeled data set where the missing labels are a binary variable indicating a class and the classes are very unbalanced (typical for anomaly detection scenarios).
I've been thinking about using an anomaly detector to help with the labeling process. The process would look something like this.
- Assume the data only contain one class
- Train the model on the entire data set
- Look closely at the output of the detector and determine if data that ranked as more unique/isolated actually includes the rare class or not.
- This process might be repeated multiple times with the newly found instances of the rare class removed prior to training the model.
This makes sense to me for labeling, but when it comes to estimating performance this just seems wrong. If I've used the detector to help me label the data, then I'd expect the performance estimates to be overly optimistic because of that. Granted, I (a human) would actually be reviewing and adding labels for the rare class.
Once the data has labels I'd split the data into training and test sets where the training set has no instances of the rare class and the test set has all instances of the rare class as well as many instances of the common class. In such a pipeline, finding "true positives" in the test set seems like a self-fulfilling prophecy. However, the model from this training/test split will be different from the model used to help with labeling since the model parameters will be estimated with less data.
In the context of this conversation, anomaly detector is a generic term and could be one of many different algorithms. For examples see https://builtin.com/machine-learning/anomaly-detection-algorithms.