Hi there,
I'm trying to do this to handle the imbalanced distribution of the target variable:
os = RandomOverSampler(1, random_state=1)
X_train, y_train = os.fit_sample(X, y)
But it doesn't work and I get this error: Input contains NaN, infinity or a value too large for dtype('float64').
I checked my data and it does not contain NaN or infinity. I can't figure out what the problem is. 😔
check your target variable whether its an integer or float. if a float convert it to integer
then run the model it should work
Thank you !!