ImportError: cannot import name 'LinearRegression' from 'sklearn'

0 votes

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'
Apr 24 in Machine Learning by akhtar
• 11,270 points
239 views

1 answer to this question.

0 votes

Hi@akhtar,

You got this error because LinearRegression is present in sklearn.model_selection module. So modify your code as follows.

from sklearn.model_selection import LinearRegression

Hope this will help.

answered Apr 24 by MD
• 24,500 points

Related Questions In Machine Learning

0 votes
1 answer

ImportError: cannot import name 'train_test_split' from 'sklearn.linear_model

Hi@MD, I think in your version, linear_model  don't have train_test_split ...READ MORE

answered Apr 13 in Machine Learning by akhtar
• 11,270 points
175 views
0 votes
0 answers

derivion logistic regresion from odds function

Feb 7 in Machine Learning by anil
• 120 points
39 views
0 votes
0 answers

NameError: name '_train' is not defined

Mar 29 in Machine Learning by anonymous
• 120 points
100 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 963 views
0 votes
0 answers
0 votes
1 answer
0 votes
1 answer

ImportError: cannot import name minimum_spanning_tree

Hi@akhtar, I think there may be problem in ...READ MORE

answered Apr 20 in Machine Learning by MD
• 24,500 points
149 views
0 votes
1 answer

Tensorflow ImportError: cannot import name'abs' error

Hi@akhtar, You may get this error, if you ...READ MORE

answered Apr 23 in Machine Learning by MD
• 24,500 points
237 views