[PYTHON] An error occurred in scikit-learn imputer

It is a memorandum.

Perhaps because I haven't caught up with the evolution of libraries around Python3 and opportunity learning, I left it here because there was an article with a description of the old state.

hoge.py


from sklearn.preproceccing import Imputer

imp = Imputer(strategy="mean",axis=0)

The above is the description used when calculating the average value of missing values, but it seems that it has already been abolished by the version. Therefore, an error will occur depending on the version. (Slightly clogged ...) After a lot of research, I found the following article, so if you want to know more about it, it is best to look at this article.

I tried to deal with the scikit-learn warning that I encountered during copying https://qiita.com/y_nishimura/items/6d022a25beb21a186d60

Then, how can I get an error?

hoge.py


from sklearn.impute import SimpleImputer

imp = SimpleImputer(strategy='mean')

It seems that it can be calculated by using SimpleImputer. It's good to study using books, but there are some errors like this, which is a pitfall.

Recommended Posts

An error occurred in scikit-learn imputer
The story of an error in PyOCR
Error in random.shuffle
scikit-learn import error
Error in Pyinstaller
Error in TensorBoard
nltk.MaxentClassifier.train () throws an error.
I get an Import Error in Python Beautiful Soup
VS Code says there is an error in cv2
I get an error when I put opencv in pyautoGUI
A story that an error occurred when PyInstaller was used in a program that uses googleapiclient
An error related to saas occurred during bundle install
Error handling in PythonBox
When you get an error in python scraping (requests)
zipimporter error in pyramid
I got an error in vim and zsh in Python 3.7 series
Quicksort an array in Python 3
[Rust] PyO3 returns an error
Multiprocessing error in Jupyter Notebook
Slice error in python (´ ; ω ; `)
Solver Problem Error in poetry
OperationalError: (psycopg2.OperationalError) gave an error
How to intentionally issue an error in the shell During testing
Resolved an error when putting pygame in python3 on raspberry pi
When I get an error with Pylint in Atom on Windows