67490/importerror-cannot-import-name-linearregression-sklearn
Hi Guys,
I am trying to create one Machine Learning model using sklearn. I installed this model but I am getting this below error.
from sklearn import LinearRegression ImportError: cannot import name 'LinearRegression' from 'sklearn'
Hi@akhtar,
You got this error because LinearRegression is present in sklearn.model_selection module. To modify your code as follows.
from sklearn.linear_model import LinearRegression
Hope this will help.
Hi@AntiModi,
Did you install sklearn module in your system? If yes, then try the below-given command.
@There,
open folder /.local/lib/python2.7/site-packages/sklearn/linear_model and open file coordinate_descent.py and delete from . import cd_fast after this import error will be removed
Hi@MD, I think in your version, linear_model don't have train_test_split ...READ MORE
Hi@akhtar, You need to install a GUI toolkit, ...READ MORE
You can also use the random library's ...READ MORE
Syntax : list. count(value) Code: colors = ['red', 'green', ...READ MORE
Enumerate() method adds a counter to an ...READ MORE
Try something like this: df.values array([[nan, 0.2, nan], ...READ MORE
Hi@akhtar, I think there may be problem in ...READ MORE
Hi@akhtar, You may get this error, if you ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.