text_plain_output_1.png image_output_1.png
from xgboost import XGBRegressor

params_xgb = {'lambda': 0.7044156083795233, 'alpha': 9.681476940192473, 'colsample_bytree': 0.3, 'subsample': 0.8, 'learning_rate': 0.015, 'max_depth': 3, 'min_child_weight': 235, 'random_state': 48, 'n_estimators': 30000}
XGBRegressor_model = XGBRegressor(**params_xgb)
'XGBRegressor_model.fit(X_train, y_train, early_stopping_rounds=200, \n             eval_set=[(X_valid, y_valid)], \n             verbose=False)\npreds_valid = XGBRegressor_model.predict(X_valid)\nprint(mean_squared_error(y_valid, preds_valid, squared=False))'