From b8b99da2075c0687688fa4293d1ab0b06945b67e Mon Sep 17 00:00:00 2001 From: 21in7 Date: Mon, 2 Mar 2026 18:24:38 +0900 Subject: [PATCH] feat: update training log and enhance ML filter functionality - Added a new entry to the training log with detailed metrics for a LightGBM model, including AUC, precision, recall, and tuned parameters. - Enhanced the MLFilter class to include a guard clause that prevents execution if the filter is disabled, improving robustness. --- models/training_log.json | 25 +++++++++++++++++++++++++ src/ml_filter.py | 1 + 2 files changed, 26 insertions(+) diff --git a/models/training_log.json b/models/training_log.json index 91f275a..bb82546 100644 --- a/models/training_log.json +++ b/models/training_log.json @@ -301,5 +301,30 @@ "max_depth": 6 }, "weight_scale": 1.783105 + }, + { + "date": "2026-03-02T18:10:27.584046", + "backend": "lgbm", + "auc": 0.5466, + "best_threshold": 0.6424, + "best_precision": 0.426, + "best_recall": 0.556, + "samples": 535, + "features": 23, + "time_weight_decay": 0.5, + "model_path": "models/lgbm_filter.pkl", + "tuned_params_path": null, + "lgbm_params": { + "n_estimators": 434, + "learning_rate": 0.123659, + "max_depth": 6, + "num_leaves": 14, + "min_child_samples": 10, + "subsample": 0.929062, + "colsample_bytree": 0.94633, + "reg_alpha": 0.573971, + "reg_lambda": 0.000157 + }, + "weight_scale": 1.783105 } ] \ No newline at end of file diff --git a/src/ml_filter.py b/src/ml_filter.py index 7da85b1..d33b430 100644 --- a/src/ml_filter.py +++ b/src/ml_filter.py @@ -107,6 +107,7 @@ class MLFilter: 모델 파일의 mtime을 확인해 변경됐으면 리로드한다. 실제로 리로드가 일어났으면 True 반환. """ + if self._disabled: return False onnx_changed = _mtime(self._onnx_path) != self._loaded_onnx_mtime lgbm_changed = _mtime(self._lgbm_path) != self._loaded_lgbm_mtime