Answers for "sklearn linear regression intercept"

8

scikit learn linear regression

from sklearn.linear_model import LinearRegression
X = np.array([[1, 1], [1, 2], [2, 2], [2, 3]])
y = np.dot(X, np.array([1, 2])) + 3
reg = LinearRegression().fit(X, y)
reg.score(X, y)
reg.coef_
reg.intercept_
reg.predict(np.array([[3, 5]]))
Posted by: Guest on September-06-2020
0

python sklearn linear regression slope

lm = LinearRegression()
lm.fit(mpg, price)

print(lm.intercept_)
print(lm.coef_)
Posted by: Guest on April-08-2021

Code answers related to "sklearn linear regression intercept"

Python Answers by Framework

Browse Popular Code Answers by Language