How noah-sokol/kalshi-mlb-predictions works
This is an MLB prediction-market system: daily runs turn game and market data into calibrated win probabilities, qualify positive edges, size suggested wagers, and track results. The graph retains the separate historical training/backtest and live recommendation workflows, plus explanations and reporting. README documentation supplies several workflow links where source excerpts were not provided; these are shown at the documented subsystem level. The sampled source confirms feature construction, edge filtering and Kelly sizing, and bet-log behavior.
Main entry points: update.py Daily runner · pipeline.py Model training · bet_tracker.py Bet tracking · edge_detector.py Edge detection
Components 22
Data ingestion
- MLB schedule
src/data/mlb_api.py - FanGraphs stats
src/data/fangraphs.py - Statcast stats
src/data/statcast.py - Game boxscores
src/data/mlb_boxscores.py - Market odds
src/data/odds_api.py - Kalshi markets
src/data/kalshi_client.py - Historical odds
src/data/historical_odds_parser.py
Modeling
- Game features
src/features/game_features.py - Bullpen features
src/features/bullpen.py - Park factors
src/features/park_factors.py - Model training
pipeline.py - Win probability model
pipeline.py - Bet explanations
src/edge/explain.py
Bet decisions
- Daily runner
update.py - Edge detection
src/edge/edge_detector.py - Kelly sizing
src/edge/kelly.py - Strategy backtest
backtest.py
Tracking
- Record actual bet
record_bet.py - Bet tracking
src/tracking/bet_tracker.py - Bet log
data/bets_log.csv - Excel tracker
export_excel.py
Other components
- Operator
Connections 24
- Operator → Daily runner: runs
- Daily runner → MLB schedule: fetches games
- Daily runner → FanGraphs stats: fetches stats
- Daily runner → Statcast stats: fetches stats
- Daily runner → Game boxscores: fetches results
- Daily runner → Market odds: fetches lines
- Daily runner → Game features: builds features
- Game features → Park factors: reads factors
- Daily runner → Win probability model: scores games
- Win probability model → Model training: uses trained model
- Daily runner → Edge detection: finds edges
- Edge detection → Kalshi markets: gets prices
- Edge detection → Kelly sizing: requests sizing
- Model training → Historical odds: merges lines
- Model training → Game features: builds training data
- Daily runner → Bet tracking: logs picks
- Bet tracking → Bet log: reads and writes
- Daily runner → Excel tracker: exports tracker
- Operator → Record actual bet: records wager
- Record actual bet → Bet tracking: records actual
- Bet tracking → Game boxscores: fills outcomes
- Strategy backtest → Historical odds: uses closing lines
- Strategy backtest → Model training: evaluates model
- Daily runner → Bet explanations: explains picks