Closes #ISSUE-027-REGIME-UI - Implement regime indicator badge and dynamic meta-learner threshold

This commit is contained in:
Antigravity Agent
2026-06-17 19:59:37 +02:00
parent dcb59c17f0
commit 1dc637aaf6
11 changed files with 103 additions and 26 deletions

View File

@@ -174,7 +174,10 @@ The workstation enforces zero silent caching or historical data ingestion:
* *Accordion Matrix*: Each log row is expandable via Chevron toggle, displaying the individual model prediction direction and success/failure correctness status checkmarks upon resolution.
* *Multi-Accuracy Tracking*: Shows distinct columns for `T+1 Acc`, `T+5 Acc`, and `T+10 Acc` rather than a single aggregated metric.
* *Global Performance Metrics Panel*: Mounted below the feedback loop, presenting Horizon Efficiency (Section A) and Estimator Hit Distribution (Section B) dynamically evaluated from `localStorage` logs.
* *Regime Status Indicator*: Renders glassmorphic conditional badges in the header of the Walk-Forward Radar based on `"activeRegime"` in the JSON payload (1 for Calm, 2 for Turbulent, 3 for Churn).
* **Quant Python Pipeline (`pipeline.py`)**:
* *Intermarket Sentiment Ingestion*: Fetches daily close values for Nasdaq Composite (`^IXIC`), Gold Spot (`GC=F`), VIX (`^VIX`), and Crypto Fear & Greed (Alternative.me API). Incorporates automatic forward-fill (`ffill()`) and backward-fill (`bfill()`) to process data gaps.
* *Feature selection gateway*: Restricts features passed to the SVM and MLP estimators to those selected by a Random Forest feature importance selector (`SelectFromModel` with threshold `"mean"`), protecting non-linear algorithms from overfitting.
* *Feature selection gateway*: Restricts features passed to the estimators to those selected by Boruta & PIMP filters, while explicitly prioritizing and bypassing pruning for all high-alpha metrics (`v_supply`, `asopr`, `sth_sopr`, `lth_sopr`, `theta`, `squeeze_risk`, `d_liq`, `f_comp`, `z_f`, `z_f_squeeze_trigger`, `cvd_inst`, `cvd_ret`, `div_cvd`, `lambda_kyle`).
* *Dynamic Meta-Learner Calibrator*: Replaces the static $\theta_{\text{conf}} = 0.55$ with a dynamic calibration threshold computed as the mean training correctness probability (`np.mean(train_r_probs)`) inside each model loop, successfully resolving the 50% entropy block.
* *Defensive Class Array Check*: Detects if the target classes array has a size smaller than 2, applying deterministic training probability fallbacks.