text_plain_output_1.png
from sklearn import metrics

from sklearn.linear_model import LinearRegression

import numpy as np # linear algebra

lr = LinearRegression()
lr.fit(x_train, y_train)

y_predict = lr.predict([[1.2], [3.3]])
y_predict

lr.score(x_test, y_test) * 100

y_predict = lr.predict(x_test)
y_predict

print(metrics.mean_absolute_error(y_test, y_predict))
print(metrics.mean_squared_error(y_test, y_predict))
print(np.sqrt(metrics.mean_squared_error(y_test, y_predict)))