text_plain_output_1.png
from sklearn.linear_model import LinearRegression

from sklearn.metrics import mean_absolute_error,mean_squared_error,r2_score

from sklearn.linear_model import LinearRegression
model = LinearRegression()
model.fit(train_x, train_y)

predict_train = model.predict(train_x)
predict_test = model.predict(test_x)

train_MAE = mean_absolute_error(train_y, predict_train)
test_MAE = mean_absolute_error(test_y, predict_test)

print('train_MAE: ', train_MAE)
print('test_MAE: ', test_MAE)