Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

SMOTE with missing values

I am trying to use SMOTE from imblearn package in Python, but my data has a lot of missing values and I got the following error:

ValueError: Input contains NaN, infinity or a value too large for dtype('float64').

I checked the parameters here, and it seems that there is not one dealing with missing value.

Is there a way to generate synthetic samples with missing values?

like image 397
MJeremy Avatar asked Aug 05 '26 12:08

MJeremy


1 Answers

SMOTE does not perform filling up your missing or NaN values. You need to fill them up and then feed for SMOTE analysis. Dealing with missing values is a different task altogether, you can take a look at Imputer from sklearn to begin with. Here is another write-up on sklearn regarding missing values : Imputing missing values

Once you have finished dealing with NaN values, then feed your modified data to SMOTE.

References

  • Predicting missing values with Scikit-learn Imputer module
  • Handling missing data with Python
  • Handling missing values
like image 53
Gambit1614 Avatar answered Aug 08 '26 01:08

Gambit1614



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!