linear regression in python
from sklearn.linear_model import LinearRegression
lm = LinearRegression()
lm.fit(X, y)
linear regression in python
from sklearn.linear_model import LinearRegression
lm = LinearRegression()
lm.fit(X, y)
python linear regression
from sklearn.linear_model import LinearRegression
#x, y = np.array([0,1,2,3,4,5])
model = LinearRegression().fit(x.reshape(-1,1), y.reshape(-1,1))
r_sq = model.score(x.reshape(-1,1), y.reshape(-1,1))
q = model.intercept_
m = model.coef_
y_fit = np.array([i*m[0] for i in x]+q[0])
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us