from sklearn import linear_model
lm=linear_model.LinearRegression()
features=['petallength']
x =iris[features]
y =iris['petalwidth']
print(x.shape,y.shape)
model=lm.fit(x,y)
print(model.intercept_,model.coef_)
model.predict([1])
from sklearn import linear_model
lm=linear_model.LinearRegression()
features=['petallength']
x =iris[features]
y =iris['petalwidth']
print(x.shape,y.shape)
model=lm.fit(x,y)
print(model.intercept_,model.coef_)
model.predict([1])