I have missing values in my Target Variable (y). Since I want to train my model with more data, I don't want to drop missing rows, instead I'd like to use KNN Imputer algorithm. But also, I'd like to prevent data leakage. So, the best way is to split the data as "train" and "test", then impute the missing target variables in the train dataset (same can be done for missing values in test dataset).
However, I faced with an error:
ValueError: Input contains NaN, infinity or a value too large for dtype('float64').
As I understand, the missing values (NaN) have created that specific error.
How to proceed when there are missing values in Target Variable?