Skip to content

fix(notebook,#18124): research_macro_factor_rotation -- real FRED factors + measured per-asset trees replace placeholder - #18165

Merged
myia-ai-01 merged 4 commits into
mainfrom
feature/18124-researchexec-macro
Sep 29, 2026
Merged

myia-ai-01 merged 4 commits into
mainfrom
feature/18124-researchexec-macro

Conversation

@jsboige

@jsboige jsboige commented Sep 28, 2026

Copy link
Copy Markdown
Owner

Grain: MED/notebook-python -- lane myia-po-2026:CoursIA -- prev: #18164

Summary

SOTA repair of Research-Executor/research_macro_factor_rotation.ipynb
(non-executed-cells family of the #18124 audit). Was: QuantBook-only,
analysis cells un-executed, fake "BACKTEST RESULTS" placeholder.

  • Real FRED factors: T10Y3M + DFF via the public fredgraph.csv endpoints
    (no API key) + real ^VIX via yfinance -- the exact series the strategy
    names (latest measured: yield_curve 0.93, fed_funds 3.88, VIX 14.87).
  • Factor <-> 21d forward SPY return correlations measured: VIX +0.247,
    yield curve -0.057, fed funds +0.021.
  • The promised per-asset DecisionTreeRegressor trained and measured
    (depth=12 as per strategy spec, temporal 70/30 split): OOS R2 = -0.669
    (SPY), -0.620 (GLD), -3.875 (BND)
    -- all three WORSE than the
    mean-prediction baseline. The honest verdict is written into the notebook:
    3 macro factors alone do not predict 21-day returns at daily granularity.
  • Rotation mechanics (1.5x leverage on positive predictions, BTC cap,
    monthly retraining) explicitly routed to the QC Cloud engine.

Validation

  • Papermill: 8/8 cells, 0 errors, all execution_count set (C.2)
  • C.1: no raise NotImplementedError / assert False / 1/0 (verified)
  • Catalogue byte-identical to main (single .ipynb changed)
  • SOTA verdict: SOTA-OK -- real FRED + index data, real measured
    correlations, trained trees with honest negative-R2 reporting

See #18124 (7 of the 10 audited notebooks now repaired by this lane;
remaining: re-audit the last 3 against current state next cycle).

🤖 Generated with Claude Code

…tors + measured per-asset trees replace placeholder

SOTA repair (non-executed-cells family of the #18124 audit). Was:
QuantBook-only, analysis cells un-executed, fake "BACKTEST RESULTS"
placeholder.

- Local research path: SPY/GLD/BND via yfinance + the REAL FRED macro series
  (T10Y3M, DFF via public fredgraph.csv) + real ^VIX -- the exact inputs the
  strategy names.
- Factor <-> 21d forward return correlations measured (VIX +0.247,
  yield curve -0.057, fed funds +0.021).
- The promised per-asset DecisionTreeRegressor (depth=12, temporal 70/30)
  trained and measured: OOS R2 = -0.669 (SPY), -0.620 (GLD), -3.875 (BND) --
  all three WORSE than the mean-prediction baseline. Honest verdict written
  in: the 3 macro factors alone do not predict 21-day returns at daily
  granularity; the strategy's edge, if any, lives in the full engine.
- Rotation mechanics (1.5x leverage, BTC cap, monthly retraining) explicitly
  routed to QC Cloud.

Executed 8/8 cells, 0 errors, all execution_count set (C.1/C.2).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

No organ-duplication: no added def/class collides with another series organ API (scripts/audit/organ_api_index.yaml).

Detector: python scripts/audit/detect_organ_duplication.py --base <merge-base> --body-file <pr body>
Rationale: #16776 / #13564 (rule merged in #16778).

@github-actions

Copy link
Copy Markdown
Contributor

Notebook outputs-required (H.4 schema): PASS (every code cell carries an outputs: list)

@github-actions

Copy link
Copy Markdown
Contributor

✅ No prose/output mismatch detected in the notebooks this PR changed.

Scope = notebooks CHANGED in this PR, not the whole corpus. Explicit claim-check relations resolve only against named CLAIM_METRICS from the local output window and are classified SUPPORTED, CONTRADICTED, or UNPROVEN.
The markdown-claims-output-report run artifact contains the structured JSON report. See python scripts/check_markdown_claims_output.py --help for re-running locally.
Detector rationale: c.290 / c.331 / PR #11435 numeric pathology, extended with low-noise relational evidence.

@github-actions

github-actions Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

Golden-Set Execution (H.7 P3)

✅ 8/8 notebooks passed (certified reproducible)

Notebook Status Time
2.1-Workflow-ML.ipynb ✅ SUCCESS 3.3s
2.2-Descente-de-gradient.ipynb ✅ SUCCESS 3.7s
2.3-Regression-lineaire-logistique.ipynb ✅ SUCCESS 4.8s
2.4-Arbres-Forets-Ensembles.ipynb ✅ SUCCESS 4.4s
Search-01-StateSpace.ipynb ✅ SUCCESS 3.2s
SL-1-LogicalLearning.ipynb ✅ SUCCESS 2.0s
rl_4_multi_armed_bandits.ipynb ✅ SUCCESS 17.6s
GameTheory-04c-NashExistence-Python.ipynb ✅ SUCCESS 2.6s

Pinned lockfile: scripts/notebook_tools/golden_set.lock.txt (H.7 P3, axe A #4208)

@github-actions

Copy link
Copy Markdown
Contributor

Notebook PR Validation: PASS

  • Notebooks checked: 1
  • Code cells validated: 4
  • Result: All passed

Checks: H.1 (no errors), H.3 (execution_count), C.1 (no banned patterns)
Non-Python kernels (.NET/Lean): C.1 + errors only (execution_count advisory)
QuantConnect notebooks: C.1 + errors only (require QC Cloud for execution)

@jsboige

jsboige commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

[ADJOINT PREFLIGHT]
schema: 1
lane: myia-po-2023:CoursIA
pr: 18165
head: 391e82c
complete: true
body: read
comments-reviewed: 5
reviews-reviewed: 0
threads-reviewed: 0
threads-unresolved: 0
surfaces-sha256: 73bcd897df1872f908728b13fcbd2317a24ea740df3496ccfb7e1a2537f0725a
diff-files: 1
diff-additions: 293
diff-deletions: 100
checks: latest-wins-green
b0: clear
scope: pass
domain: not-applicable
verdict: READY
[/ADJOINT PREFLIGHT]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

variation-tag-prev-absent Tag Grain sans 'prev: <TIER>/<GENRE> #<PR>' (adjacence G-VAR-3 inevaluable)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants