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

2

6

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.
Valgus answered 12/5, 2019 at 14:18 Comment(5)
There is a issue with their function and its default parameters it seems. The ADAYSN function with default parameters itself is not working.Fideicommissum
Did you manage to fix this problem? I am having the same issueSynesthesia
Yeah, me too. What's the solution?Dismissal
I obtained this error when I accidentally ran ADASYN on a dataset that was already balanced.Latricelatricia
What's the solution?Doglike
C
2

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......#

Coagulase answered 31/5, 2019 at 13:2 Comment(1)
Can you provide what exactly you are trying to explain hereLupelupee
C
6

I had this problem too, finally i solved it!

  1. you should use sampling_strategy instead of ratio
  2. sampling_strategy='minority'

I tried other options such as 'not_majority' ,'auto' and dictionary form, all of them gave the following error

Value Error: No samples will be generated with the provided ratio settings

but 'minority' worked.

Campuzano answered 11/5, 2020 at 16:29 Comment(0)
C
2

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......#

Coagulase answered 31/5, 2019 at 13:2 Comment(1)
Can you provide what exactly you are trying to explain hereLupelupee

© 2022 - 2024 — McMap. All rights reserved.