refactor(training): 简化 LightGBM 模型参数处理

- 重构 LightGBM 和 LambdaRank 模型,移除参数提取逻辑
- 模型类只保留 params 属性,符合 LightGBM 设计规范
This commit is contained in:
2026-03-14 02:41:24 +08:00
parent ecb22b826c
commit bdf937086f
4 changed files with 105 additions and 864 deletions

File diff suppressed because one or more lines are too long

View File

@@ -293,6 +293,7 @@ SELECTED_FACTORS = [
"net_profit_yoy",
"revenue_yoy",
"healthy_expansion_velocity",
"ebit_rank",
# ================= 6. 基本面估值与截面动量共振 =================
"EP",
"BP",
@@ -304,12 +305,11 @@ SELECTED_FACTORS = [
"pe_expansion_trend",
"value_price_divergence",
"active_market_cap",
"ebit_rank",
]
# 因子定义字典(完整因子库)
FACTOR_DEFINITIONS = {
"turnover_rate_volatility": "ts_std(log(turnover_rate), 20)"
# "turnover_rate_volatility": "ts_std(log(turnover_rate), 20)"
}
# Label 因子定义(不参与训练,用于计算目标)
@@ -341,7 +341,7 @@ MODEL_PARAMS = {
"max_depth": 4,
"min_data_in_leaf": 20,
"n_estimators": 2000,
"early_stopping_round": 300,
"early_stopping_round": 100,
"subsample": 0.8,
"colsample_bytree": 0.8,
"reg_alpha": 0.1,
@@ -372,7 +372,7 @@ def stock_pool_filter(df: pl.DataFrame) -> pl.Series:
)
valid_df = df.filter(code_filter)
n = min(1000, len(valid_df))
n = min(500, len(valid_df))
small_cap_codes = valid_df.sort("total_mv").head(n)["ts_code"]
return df["ts_code"].is_in(small_cap_codes)