From dc50add8a78ebf34bc7bb050c1a0e61d207b9544 Mon Sep 17 00:00:00 2001 From: Rohan Anand <96521078+rohan472000@users.noreply.github.com> Date: Sat, 23 Sep 2023 14:21:36 +0530 Subject: [PATCH] Update xgboost_regressor.py (#9078) * Update xgboost_regressor.py * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- machine_learning/xgboost_regressor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/machine_learning/xgboost_regressor.py b/machine_learning/xgboost_regressor.py index 023984fc1..a540e3ab0 100644 --- a/machine_learning/xgboost_regressor.py +++ b/machine_learning/xgboost_regressor.py @@ -27,7 +27,9 @@ def xgboost( ... 1.14300000e+03, 2.60958904e+00, 3.67800000e+01, -1.19780000e+02]])) array([[1.1139996]], dtype=float32) """ - xgb = XGBRegressor(verbosity=0, random_state=42) + xgb = XGBRegressor( + verbosity=0, random_state=42, tree_method="exact", base_score=0.5 + ) xgb.fit(features, target) # Predict target for test data predictions = xgb.predict(test_features)