Views
No views yet
The "model" that wins is a zero-parameter 3-factor linear composite. This card documents that champion, the ML baselines that fail to beat it, and the evaluation ruler that makes the comparison honest. Code is Apache-2.0; the price data it trains on is not redistributed (see the Dataset Card).
| Task | Cross-sectional P(trade succeeds) / tradeability ranking on B3 equities |
| Champion | Linear fundamental tilt — equal-weight mean of cross-section ranks of earnings_yield, book_to_price, profit_margin |
| Trainable params | 0 (fixed equal-weight composite, no tuning) |
| Construction | long top tercile, short bottom tercile, equal-weight, market-neutral |
| Rebalance | quarterly (63 trading days) — turnover is the whole game |
| Costs | square-root market impact (Tóth et al.) + 5bps half-spread, one-way |
| Baselines | LightGBM LambdaRank (40 feat), TabPFN v2 (foundation tabular small-N) |
| Metric | Value |
|---|---|
| Sharpe gross | +0.19 |
| Sharpe net (one-way costs) | +0.18 |
| PSR(net>0) | 0.92 |
| DSR (deflated, 18 trials) | 0.72 |
| Annualized (×√(252/63)) | ~0.35 |
| Verdict | first & only economically viable config |
| Model | Features | Turnover/rebal | Rank IC OOS | Net Sharpe | Verdict |
|---|---|---|---|---|---|
| Linear composite (champion) | 3 fundamental | low (~0.4) | — | +0.18 | viable |
| TabPFN v2 | 3 fundamental | low | — | +0.183 | ties champion |
| TabPFN v2 | all (TS+micro+regime+fund) | 1.10 | — | worse | loses (churn) |
| LightGBM LambdaRank | 40 | high | −0.014 | ~0 | overfits |
cpcv.append_trial / deflated_sharpe(..., n_trials=real_count)).net Sharpe > 0) before running — no metric
shopping. See fundamental_tilt.py docstring.half_spread_bps and eta are conservative floors, not
central estimates; participation is a placeholder until real R$ volume lands.1uv sync
2echo "BRAPI_TOKEN=your_key" > .env # your own key; gitignored
3uv run python -m stockprecog.brapi_ingest # rebuild local panel (not shipped)
4uv run python -m stockprecog.fundamental_tilt # champion (pre-registered)
5uv run python -m stockprecog.rank_model # LightGBM LambdaRank baseline
6uv run python -m stockprecog.rank_tabpfn # TabPFN v2 baseline (GPU)
7uv run pytest -q # 26 tests (ruler invariants)paper.pdf
· DOI: 10.5281/zenodo.20706701 (concept DOI — latest version)1@software{barbosa_stockprecog_2026,
2 author = {Barbosa, João Henrique},
3 title = {stockprecog: An honest-invalidation study of cross-sectional
4 return prediction on the Brazilian equity market (B3)},
5 year = {2026},
6 publisher = {Zenodo},
7 version = {v1.0.0},
8 doi = {10.5281/zenodo.20706701},
9 url = {https://doi.org/10.5281/zenodo.20706701}
10}