Apr-25-2020, 07:50 PM
In the following snippet of code, I made a replacement:
Now I get the following error when I run the code.
sklearn 0.0
see attached screenshot. What import app covers this function?
It seems that I have sklearn 0.0 installed. That make no sense.
HowdoI correct this error. Is this handled by scikit-learn?
I am not sure what to do.
Respectfully,
ErnestTBass
import pandas as pd import numpy as np from sklearn.linear_model import LinearRegression from sklearn.cross_validation import train_test_split from sklearn.preprocessing import Imputer import matplotlib.pyplot as plt %matplotlib inlineThe new code is
import pandas as pd import numpy as np from sklearn.linear_model import LinearRegression from sklearn.model_selection import train_test_split from sklearn.preprocessing import Imputer import matplotlib.pyplot as plt %matplotlib inlineI replaced cross_validation in line 4 with model selection. It worked.
Now I get the following error when I run the code.
Error:ImportError Traceback (most recent call last)
<ipython-input-11-8cc04663b4cc> in <module>
3 from sklearn.linear_model import LinearRegression
4 from sklearn.model_selection import train_test_split
----> 5 from sklearn.preprocessing import Imputer
6 import matplotlib.pyplot as plt
7
ImportError: cannot import name 'Imputer' from 'sklearn.preprocessing' (/opt/conda/lib/python3.7/site-packages/sklearn/preprocessing/__init__.py)
Now I am confused since when I ran pip list and conda list I got that sklearn 0.0
see attached screenshot. What import app covers this function?
It seems that I have sklearn 0.0 installed. That make no sense.
HowdoI correct this error. Is this handled by scikit-learn?
I am not sure what to do.
Respectfully,
ErnestTBass