text_plain_output_1.png image_output_1.png
from sklearn.linear_model import LinearRegression

from sklearn.metrics import mean_squared_error, r2_score

model_base = LinearRegression()
model_base.fit(X_train, y_train)
preds_valid_base = model_base.predict(X_valid)
print('MAE', mean_squared_error(y_valid, preds_valid_base, squared=False))
print('r2', r2_score(y_valid, preds_valid_base))