Search code examples
python-3.xscikit-learnresamplingimblearn

How to fix: No samples will be generated with the provided ratio settings. (imblearn)


I have this code:

from imblearn.over_sampling import ADASYN

Y = df.target
X = df.drop('target', axis=1)

ad = ADASYN()
X_adasyn, y_adasyn = ad.fit_sample(X, Y)

getting this error:

ValueError: No samples will be generated with the provided ratio 
settings.

Solution

  • Make it a two. There is github and it explicitly says:

    if not np.sum(n_samples_generate):
                    raise ValueError("No samples will be generated with the"
                                     " provided ratio settings.")
    

    but, yeah......#