Answers for "drawing linear regression in python"

0

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])
Posted by: Guest on October-02-2021
0

real python linear regression

dataset = pd.read_csv('/Users/nageshsinghchauhan/Documents/projects/ML/ML_BLOG_LInearRegression/Weather.csv')
Posted by: Guest on June-24-2021

Code answers related to "drawing linear regression in python"

Python Answers by Framework

Browse Popular Code Answers by Language