text_plain_output_1.png
from sklearn.metrics import mean_squared_error, mean_absolute_error

from xgboost import XGBRegressor

model = XGBRegressor(n_estimators=1000, learning_rate=0.05, gamma=0.2)
model.fit(X_train, y_train, early_stopping_rounds=5, eval_set=[(X_test, y_test)], verbose=False)
y_predict = model.predict(X_test)
print('MSE', mean_squared_error(y_test, y_predict, squared=False))
print('MAE', mean_absolute_error(y_test, y_predict))