summaryrefslogtreecommitdiff
path: root/lib/parameters.py
diff options
context:
space:
mode:
authorBirte Kristina Friesel <birte.friesel@uos.de>2024-01-10 11:44:54 +0100
committerBirte Kristina Friesel <birte.friesel@uos.de>2024-01-10 11:44:54 +0100
commite2f1f5d08e8e032d917cb2a7ba329db1bee9c2ee (patch)
tree021edc75974d62f9fadc7c18401a922b9cb445f8 /lib/parameters.py
parent0c3f350a577cfb1b36d45707ae3f36c2fe0d46ba (diff)
Expose more XGBoost training hyper-parameters via environment variables
Diffstat (limited to 'lib/parameters.py')
-rw-r--r--lib/parameters.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/parameters.py b/lib/parameters.py
index 74f1007..bc0d2a1 100644
--- a/lib/parameters.py
+++ b/lib/parameters.py
@@ -1087,9 +1087,11 @@ class ModelAttribute:
xgb = xgboost.XGBRegressor(
n_estimators=int(os.getenv("DFATOOL_XGB_N_ESTIMATORS", "100")),
max_depth=int(os.getenv("DFATOOL_XGB_MAX_DEPTH", "10")),
- subsample=0.7,
- gamma=0.01,
- reg_alpha=0.0006,
+ subsample=float(os.getenv("DFATOOL_XGB_SUBSAMPLE", "0.7")),
+ eta=float(os.getenv("DFATOOL_XGB_ETA", "0.3")),
+ gamma=float(os.getenv("DFATOOL_XGB_GAMMA", "0.01")),
+ reg_alpha=float(os.getenv("DFATOOL_XGB_REG_ALPHA", "0.0006")),
+ reg_lambda=float(os.getenv("DFATOOL_XGB_REG_LAMBDA", "1")),
)
fit_parameters, category_to_index, ignore_index = param_to_ndarray(
parameters, with_nan=False, categorial_to_scalar=categorial_to_scalar