feat(training): 添加缺失值填充处理器 NullFiller

新增 NullFiller 处理器,支持 zero/mean/median/value 填充策略,
支持全局统计量或按日期截面填充。在回归训练流程中添加 NullFiller。
This commit is contained in:
2026-03-05 21:57:34 +08:00
parent aefe6d06cf
commit 7b935b0fa3
4 changed files with 206 additions and 3 deletions

View File

@@ -19,7 +19,7 @@ from src.training import (
StockFilterConfig,
StockPoolManager,
Trainer,
Winsorizer,
Winsorizer, NullFiller,
)
from src.training.config import TrainingConfig
@@ -224,6 +224,7 @@ def train_regression_model():
# 6. 创建数据处理器(从 PROCESSOR_CONFIGS 解析)
processors = [
NullFiller(strategy="mean"),
Winsorizer(**PROCESSOR_CONFIGS[0]["params"]), # type: ignore[arg-type]
StandardScaler(exclude_cols=["ts_code", "trade_date", target_col]), # type: ignore[call-arg]
]