improve model training

This commit is contained in:
2026-03-12 20:39:44 +11:00
parent 20316cee91
commit 9785fc0235
8 changed files with 536 additions and 4 deletions

View File

@@ -54,6 +54,7 @@ class WorkerConfig:
tune_hyperparameters: bool
max_hyperparam_trials: int
calibration_methods: str
threshold_policy: str
walk_forward_folds: int
allow_empty_data: bool
dataset_path_template: str
@@ -194,6 +195,8 @@ def run_training_cycle(cfg: WorkerConfig, env: dict[str, str]) -> None:
str(cfg.max_hyperparam_trials),
"--calibration-methods",
cfg.calibration_methods,
"--threshold-policy",
cfg.threshold_policy,
"--walk-forward-folds",
str(cfg.walk_forward_folds),
"--feature-set",
@@ -300,6 +303,7 @@ def load_config() -> WorkerConfig:
tune_hyperparameters=read_env_bool("RAIN_TUNE_HYPERPARAMETERS", False),
max_hyperparam_trials=read_env_int("RAIN_MAX_HYPERPARAM_TRIALS", 12),
calibration_methods=read_env("RAIN_CALIBRATION_METHODS", "none,sigmoid,isotonic"),
threshold_policy=read_env("RAIN_THRESHOLD_POLICY", "validation"),
walk_forward_folds=read_env_int("RAIN_WALK_FORWARD_FOLDS", 0),
allow_empty_data=read_env_bool("RAIN_ALLOW_EMPTY_DATA", True),
dataset_path_template=read_env(
@@ -341,6 +345,7 @@ def main() -> int:
f"train_interval_hours={cfg.train_interval_hours} "
f"predict_interval_minutes={cfg.predict_interval_minutes} "
f"tune_hyperparameters={cfg.tune_hyperparameters} "
f"threshold_policy={cfg.threshold_policy} "
f"walk_forward_folds={cfg.walk_forward_folds} "
f"allow_empty_data={cfg.allow_empty_data} "
f"model_backup_path={cfg.model_backup_path}",