Python Forum
Only one coefficient for linear model?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Only one coefficient for linear model?
#1
Confused: The website below shows a single estimated coefficient, but, to estimate a line, shouldn't you have two coefficients? (slope and y-intercept estimates)?

http://scikit-learn.org/stable/auto_exam...lot-ols-py

What am I missing?

Thanks,
Reply
#2
Here is documentation of sklearn.linear_model.LinearRegression():
http://scikit-learn.org/stable/modules/g...Regression
You found that coefficients are in coef_ member variable. The intercept value is in intercept_ member variable.
Reply
#3
Thanks. Still finding my way around, though skikit-learn has great docs.

- O
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  model.fit and model.predict errors hatflyer 6 1,192 Nov-10-2023, 01:39 AM
Last Post: hatflyer
  SOlving LInear Equations in Python(Symoy, NUmpy) - Coefficient Problem quest 3 1,691 Jan-30-2022, 10:53 PM
Last Post: quest
  FileNotFoundError: [Errno 2] No such file or directory: 'model/doc2vec.model/Articles Anldra12 10 5,680 Jun-11-2021, 04:48 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020