perf: trim persisted ML fold metadata
This commit is contained in:
+9
-1
@@ -164,6 +164,14 @@ def viable_classification_splits(y, splits):
|
||||
yield train_idx, val_idx
|
||||
|
||||
|
||||
def artifact_fold_results(fold_results):
|
||||
"""Strip training-only row indexes from the persisted ML artifact."""
|
||||
return [
|
||||
{key: value for key, value in fold.items() if key not in {"train_idx", "val_idx"}}
|
||||
for fold in fold_results
|
||||
]
|
||||
|
||||
|
||||
def _build_model():
|
||||
return GradientBoostingClassifier(
|
||||
n_estimators=300,
|
||||
@@ -503,7 +511,7 @@ def train_model(rows):
|
||||
"mean_recall": round(float(np.mean(cv_recall)), 4),
|
||||
"validation_method": "purged_expanding_window",
|
||||
"label_horizon_days": LABEL_HORIZON_DAYS,
|
||||
"folds": fold_results,
|
||||
"folds": artifact_fold_results(fold_results),
|
||||
},
|
||||
"training_info": {
|
||||
"n_samples": len(labeled),
|
||||
|
||||
Reference in New Issue
Block a user