generated from mathias/template-go-web
fix(features): revert to 2-channel default; OHLCV features redundant
HPO finding: hl_range≈realized_vol, ret_intrabar≈ret — correlation kills signal. 4ch D=128: 0.3503, 4ch D=256: 0.3807, 2ch D=128 baseline: 0.3908 (winner). Parquet keeps hl_range+ret_intrabar; comment in build() documents the attempt. test_build_uses_4_channels → test_build_uses_2_channels (tracks current default). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -154,10 +154,9 @@ def build():
|
||||
else:
|
||||
df = pd.read_parquet(daily_path).reset_index(drop=True)
|
||||
df["date"] = pd.to_datetime(df["date"])
|
||||
# Use OHLCV-derived features when available; fall back to 2-channel
|
||||
base_feats = ["ret", "realized_vol"]
|
||||
extra_feats = [c for c in ["hl_range", "ret_intrabar"] if c in df.columns]
|
||||
FEAT_COLS = base_feats + extra_feats
|
||||
# 2-channel default (HPO: adding hl_range+ret_intrabar hurt — correlated with base feats)
|
||||
# To experiment: change to ["ret", "realized_vol", "hl_range", "ret_intrabar"]
|
||||
FEAT_COLS = ["ret", "realized_vol"]
|
||||
feats = df[FEAT_COLS].to_numpy(np.float32)
|
||||
target = df["realized_vol"].to_numpy(np.float32)
|
||||
tr_idx = df.index[df["date"].dt.year <= 2021].tolist()
|
||||
|
||||
Reference in New Issue
Block a user