🗄️ 歴史的文書(アーカイブ) — この文書は過去の研究フェーズの記録であり、現在の結論・手法を反映していません。現在の研究状況は解説セクションを参照してください。
Phase 4 — ML 戦略再訓練プラン(plan-only)
本ページは、既存 4 ML 戦略(ml_direction_linear / ml_direction_logistic / ml_hold10_softmax / ml_multihorizon_ticker)を Phase 2/2b 発見のシグナル群と NITS 正規化特徴量で再訓練する計画を整理したもの。現時点ではコードもモデルも未修整(plan のみ)。
- Date: 2026-04-21
- Status: plan-only(訓練実行なし、コード変更なし)
- Upstream reports:
- Phase 2 — Microstructure alpha signal candidates
- Phase 2b — Alternative alpha candidates + regime classifier
src/atc/strategies/ml/— 既存 4 戦略rust/atc-featuregen/src/model.rs— NITS 正規化済み特徴列(Phase 4d で実装済み)
TL;DR
- 既存 4 モデルは 2022-01-01 .. 2025-12-31 で訓練済、Phase 2/2b 発見シグナル(
top1_vs_deep,cvd_accel,vwap_dev_*_bps,signed_vpin_5mなど)も NITS 正規化特徴も 未使用 - Validation AUC は 0.51-0.62(linear ceiling)
- 最優先:Rust feature cache を拡張して Phase 2/2b シグナル 7 列を
FeatureRowに追加(~300-500 LOC + ~4h キャッシュ再構築)→ これが 唯一のハードブロッカー - 再訓練後の予測 AUC:
ml_direction_gbdt(新規 LightGBM)で 0.68 前後(+0.06)、ml_hold10_softmaxMLP で macro-F1 0.37(+0.03)
1. 既存 ML 戦略の監査
| # | Strategy | Model artifact (latest) | Train window | 特徴数 | Target | Valid metric |
|---|---|---|---|---|---|---|
| 1 | ml_direction_linear | ml_direction_linear_ETH_JPY_2022-01-01_2025-12-31.json | 2022-01 → 2025-12 | 13 | fwd log-return 300s (regression) | MSE 1.97e-5, dir acc 0.509 |
| 2 | ml_direction_logistic | ml_direction_logistic_ETH_JPY_2022-01-01_2025-12-31.json | 同上 | 13 | hold10-oracle binary | acc 0.860, AUC 0.624 |
| 3 | ml_hold10_softmax | ml_hold10_softmax_ETH_JPY_2022-01-01_2025-12-31.json | 同上 | 13 | 3-class softmax(HOLD/FLAT/SHORT, cost-aware) | acc 0.511, macro F1 0.340 |
| 4 | ml_multihorizon_ticker | ml_multihorizon_ticker_ETH_JPY_2022-01-01_2025-12-31.json | 同上 | 16(ticker-only) | 4 heads (H=1/5/30/300s) binary | AUCs 0.528 / 0.523 / 0.516 / 0.513 |
既知の問題
- Phase 2/2b シグナル未使用:best individual Pearson-ρ(
top1_vs_deep@ 5s = +0.089 rally,mscale_consensus_3sigHAC |t|=9.48)が全モデル不可視 - NITS 正規化未使用:Phase 4d で実装済みの 30+ z-score/MAD/log 列を 4 モデルとも使っていない。raw 特徴は 4-5 桁のスケール差があり logistic/linear fit がスケール dominated
ml_direction_logisticの 0.860 は misleading:hold10_oracle ターゲットは ~86% HOLD で、trivial always-HOLD baseline が既に 0.86。実効 edge は AUC 0.624- Validation split が random 80/20(time-forward でない)→ 近接日が train/valid に leak。Phase 4 再訓練では 2026-02-17..04-19(Phase 1.5-v2 holdout)を out-of-sample に
ml_multihorizon_tickerの AUC が horizon 間で平坦(0.51-0.53)→ 16 特徴が不足、もしくは label noise が 1s/5s で dominate
2. 追加提案する特徴量
2.1 NITS 正規化(Rust cache 既存 — Rust 追加作業なし)
全 4 モデルで以下を採用:
- Z-scores:
logret_1s_z_300s,logret_5s_z_300s,trade_vol_1s_z_300s,trade_imbalance_1s_z_300s,ob_imbalance_top1_z_300s,ob_imbalance_top5_z_300s,spread_bps_z_300s,rv_30s_z_1800s— 8 列 - Robust/MAD:
trade_size_robust_300s,trade_vol_1s_robust_1800s— 2 列 - Log transforms:
trade_size_log,trade_vol_1s_log,depth_bid_top5_log,depth_ask_top5_log— 4 列 - Time-of-day:
tod_sin,tod_cos,biz_day_frac— 3 列(ttc_sec_norm置換)
合計 +17 NITS 列/モデル。
2.2 Phase 2 / 2b 新シグナル(Rust 拡張必須)
FeatureRow に 7 列追加:
| 列 | 定義 | LOC 見積 |
|---|---|---|
ob_imb_deep_5to30 | L5〜L30 の深層 book imbalance | ~50 + L30 露出 |
top1_vs_deep | ob_imbalance_top1 - ob_imb_deep_5to30 | derived |
big_trade_fresh_sign | rolling p95 の trade_size + last-big-trade 追跡 | ~30 |
cvd_accel | sv_5s/5 - sv_30s/30 | ~40 |
vwap_dev_1m_bps, vwap_dev_30m_bps | rolling VWAP | ~40 |
signed_vpin_5m | sv_300s / v_300s | ~20 |
mscale_consensus_3sig | 3-signal consensus gate | ~15 |
合計:~300-500 LOC Rust + キャッシュ version bump(backend=rust-v4)+ 2022-2026 再構築(8 workers で ~4h)。
2.3 ドロップすべき特徴
in_no_new_entry_window:session-boundary flag、data integrity 用に残すが training 入力からはbiz_day_fracで代替ttc_sec_norm:tod_sin/cos+biz_day_fracが strictly more expressiveob_imbalance_top5:Phase 2 §68 で |ρ| < 0.012 の losing signal。ob_imb_deep_5to30(|ρ|>0.045, stable across regimes)で置換
2.4 モデル別特徴構成(再訓練後)
| Model | Existing | +NITS | +Phase2/2b | Dropped | New total |
|---|---|---|---|---|---|
ml_direction_linear | 13 | +17 | +7 | -1 | 36 |
ml_direction_logistic | 13 | +17 | +7 | -1 | 36 |
ml_hold10_softmax | 13 | +17 | +7 | -1 | 36 |
ml_multihorizon_ticker | 16(ticker-only) | +8(ticker-compat のみ) | 0(設計上 ticker-only 維持) | 0 | 24 |
ml_multihorizon_ticker は ticker-only 哲学を維持。代わりに sibling model ml_multihorizon_full(trade/book 含む)を新 architecture として提案(§4)。
3. 訓練プロトコル
3.1 訓練ウィンドウ
- Train:2022-01-01 .. 2026-02-16(4 年 + 1.5 ヶ月)
- Internal validation:last 10% of train(time-forward)
- Out-of-sample holdout:2026-02-17 .. 2026-04-19(Phase 1.5-v2 window) — モデル選択には一切使わない
3.2 コスト見積
| Model | Rows (est. train) | Feature cols | 訓練時間 | アーティファクトサイズ |
|---|---|---|---|---|
ml_direction_linear | ~46M | 36 | 45 min(ridge closed-form) | ~12 KB |
ml_direction_logistic | ~48M | 36 | 2.5 h(SGD 40 epoch, MPS) | ~12 KB |
ml_hold10_softmax (linear) | ~46M | 36 | 3 h | ~30 KB |
ml_hold10_softmax (MLP [128,64]) | ~46M | 36 | 8-12 h MPS | ~75 KB |
ml_multihorizon_ticker | ~8M (1Hz grid) | 24 | 45 min | ~10 KB |
Feature cache disk:backend=rust-v4 は 2022-2026-02 で ~1.2-1.4 GB。
3.3 ハイパラ(既存踏襲)
- Logistic / softmax:epochs 40-60, lr 0.05, L2 1e-4, batch 8192-65536, MPS
- Ridge:alpha 1.0
horizon_sec=300(Phase 1.5-v2min_order_interval=300と整合)class_positions_eth=[10.0, 0.0, -10.0](10-ETH benchmark と整合)flat_cost_bps=2.0, short_cost_bps=4.0(cost-aware labels)
4. 新 architecture 提案
4.1 ml_direction_gbdt(LightGBM)
- Library:
lightgbm(新規依存, 10MB wheel, pyproject.toml[project.optional-dependencies.ml]に追加) - Config:
LGBMClassifier(binary, hold10_oracle target), 500 trees, max_depth=8, num_leaves=63, min_child_samples=1000, lr=0.05, feature_fraction=0.9, bagging_fraction=0.8, bagging_freq=5, early_stopping 50 - Why:既存 linear 4 モデルは全て AUC 0.52-0.62 で天井。Trees は linear 不可能な interaction(例
top1_vs_deep × rv_30s_z_1800s × biz_day_frac → P(up))を学習できる - 訓練コスト:~4h CPU (16 core), ~15-25 GB RAM(histogram based)
- 予測 AUC gain:+0.04〜+0.08 vs linear(0.624 → ~0.68)
- Risk:個別日/regime への overfit。6-fold time-forward CV(8 month each)でゲート、train-vs-valid gap > 0.03 は reject して logistic fallback
4.2 ml_multihorizon_transformer(軽量 Transformer)
- Library:
torch(既存 deps) - Architecture:4-layer Transformer encoder,
d_model=64,nhead=4, dropout 0.1, 128-tick lookback(1Hz sub-sampled)。Input 24 ticker 特徴、4 output heads(1/5/30/300s binary)、per-head temperature scaling - Why:ticker-only stream には明確な時系列構造があり、pointwise logistic では exploit できない。Multi-head attention over 128 ticks で regime transition を捕捉
- 訓練コスト:~8-12h MPS または ~3-4h A100
- 予測 AUC:0.55-0.62(+0.04 vs 現 0.52-0.53)
- Risk:transformer はハイパラ敏感。最小構成(4-layer, 64-d)から開始、calibration 必須
5. ブロッカー
5.1 【HIGH】Rust feature cache 拡張
ブロッカー:Phase 2/2b シグナルが Rust cache に無い(§2.2)。
- (A) Rust 拡張 (推奨):300-500 LOC + ~4h 再構築 →
backend=rust-v4。全 ML + 戦略の将来作業を unblock - (B) Python shim:
ml_linear.py/ml_multihorizon_ticker.py内で per-event 計算 → ~100 LOC Python だが訓練時間が ~10× に膨張、毎回再計算。非推奨
推奨:(A)。Phase 4 の prereq ticket として独立化。
5.2 【MEDIUM】NITS cache の全期間ビルド
backend=rust-normalized は現在 1 日分(2026-02-15)のみ(2.8 MB)。2022-2026 全体の正規化キャッシュ再構築が必要:
- Rows ~48M, cols +37 vs 現 21
--workers 8で 3-5h- Disk ~1.2-1.8 GB parquet
- 一度払えば再訓練は amortize
5.3 【OK】データ完全性
data/canonical/events/symbol=ETH_JPY/に 2022-01 から 2026-03 が完備(12×4+4 ヶ月)- 既存
features_2022-01-01_2025-12-31_v1.parquet(674 MB)で pipeline 確認済み - ブロッカーではない
5.4 【LOW】LightGBM 依存追加
lightgbm>=4.0 を pyproject.toml に追加(10-15 MB wheel、pure C++ backend、標準ツール、ライセンス問題なし)。
6. Top-3 実験ランキング(期待 alpha / コスト順)
| Rank | Experiment | 推定コスト | 期待 lift | 根拠 |
|---|---|---|---|---|
| 1 | ml_direction_gbdt — LightGBM binary on 36-feature set | Rust 作業 ~2d + 訓練 ~4h CPU + integration ~1d | +0.06 AUC vs logistic(0.624 → ~0.68), 62-day holdout で ¥1-3M lift 可能性 | Phase 2/2b シグナル間の interaction 捕捉が最大。established in microstructure ML |
| 2 | ml_multihorizon_ticker NITS 再訓練 — 同 architecture, 24 features, clean 2022→2026-02 train / holdout | Rust 作業なし + 訓練 ~45 min | +0.02 AUC @ H=300s(0.513 → ~0.54)。Minor lift だが最安 | NITS 単独の ML 価値を end-to-end 検証。AUC 動かなければ Phase 4d の ML 価値は低と判定できる fast decision-maker |
| 3 | ml_hold10_softmax MLP 再訓練(36 特徴) — 3-class, MLP [128,64], MPS, 60 epoch | Rust 作業 ~2d(#1 と共有)+ 訓練 ~10h | +0.03 macro-F1(0.340 → ~0.37), regime-switch lift ¥500k-1M | 10-ETH benchmark と意味的整合が最高。MLP は interaction 学習可だが既存 inference pipeline 内 |
Below top-3(Phase 4.5 以降):
4. ml_direction_linear 再訓練 — low lift(linear ceiling 0.52-0.55)、#1 と cost-redundant
5. ml_multihorizon_transformer(§4.2)— 高コスト(~10h 訓練)+ 高分散、#1-3 で特徴セット確定後に
6. 4 モデル walk-forward CV — production には必須だが別 ticket
7. まとめ
- 既存 4 ML モデルは Phase 2/2b シグナルも NITS も未使用、linear AUCs 0.51-0.62、Phase 1.5-v2 leaderboard に未登場
- 提案:+17 NITS + +7 Phase 2/2b シグナル = +24 特徴/モデル
- 訓練ウィンドウ:2022-01-01 → 2026-02-16、holdout 2026-02-17..04-19(Phase 1.5-v2)
- 新 architecture:LightGBM GBDT, 小型 Transformer
- ブロッカー:(A) Rust feature cache 拡張(300-500 LOC, ~4h)、(B) normalized-cache 全期間再構築(3-5h)
- Top-3 実験:
ml_direction_gbdt,ml_multihorizon_tickerNITS 再訓練,ml_hold10_softmaxMLP 再訓練 - タイムライン:top-3 全追求で ~5-7 working days(Rust 作業 + validation 含む)