Here's the thing, I have an imbalanced data and I'm trying to use Undersampling.
Perhaps people don't have the solution to my error, but if this is the case, any alternative would be appreciated.
This is what I've done:
from imblearn.under_sampling import RandomUnderSampler
rus = RandomUnderSampler(random_state=0)
X_train_resampled, y_train_resampled = rus.fit_sample(X_train, y_train)
However, I keep getting the error:
AttributeError: 'RandomUnderSampler' object has no attribute '_validate_data'
I saw this post RandomUnderSampler' object has no attribute 'fit_resample', but the answer didn't work. I upgraded the library, it didn't work. I also tried using fit_resample and I got the exact same error.
Any ideas on how to fix this error OR other way of applying Undersampling?
UPDATE: The whole error below (can't show the real data, privacy concerns)
Regarding the version: my Python is 3.7 and scikit-learn 0.23.1