Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can not use MICE from fancyimputer (Python)

I am just trying to use the MICE function from fancyimpute. Simple line of code from fancyimpute import MICE gives an error cannot import name 'MICE'

I did try to consult https://github.com/iskandr/fancyimpute (i find it strange that MICE is nowhere to be found there but then people are implementing it https://medium.com/logicai/5-useful-python-packages-from-kaggles-kernels-you-didn-t-know-existed-part-2-4b35ba2d812) as well as similiar problems on stack concerning MICE and importing problems but without of luck

like image 739
Noah Weber Avatar asked Sep 03 '26 23:09

Noah Weber


1 Answers

The below steps worked for me on MAC OSX.

  1. Use easy_install fancyimpute in your terminal instead of pip install fancyimpute

Unable to install fancyimpute for use in Jupyter

  1. Use 'from fancyimpute import IterativeImputer as MICE' in your jupyter notebook. Looks like MICE is now called IterativeImputer.

https://github.com/iskandr/fancyimpute/issues/81

  1. Use 'df1 = MICE().fit_transform(df)' on your dataframe. Looks like IterativeImputer does not have the function/method 'complete' anymore and the fit or fit_transform should be used with it instead.
like image 167
ARV Avatar answered Sep 05 '26 16:09

ARV



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!