How liamrogan1/mlb_monte_carlo works
This repository is an MLB player-prop analytics and betting project. Its clearest runtime workflow is collecting and snapshotting pitcher strikeout/walk odds, using pred_tb.py to simulate player outcomes and evaluate bets, then reviewing backtests or outcome distributions. Separate data-preparation code pulls and blends baseball statistics, while k_rate_regression.py derives training targets and features. The excerpts do not establish how the saved model or prepared datasets connect to the prediction script, so those links are omitted; several capabilities are inferred only from sampled code.
Main entry points: import_odds.py Odds collector · import_data.py Stats and results · pred_tb.py Prop simulation · k_rate_regression.py Statcast features
Components 14
Odds collection
- Odds collector
import_odds.py - Odds snapshots
import_odds.py
Baseball data
- Stats and results
import_data.py - Player identity
update_pdb.py
Prop analysis
- Prop simulation
pred_tb.py - Bet backtesting
pred_tb.py - Outcome distributions
display_outcomes.py - Hypothesis testing
hyp_test.py
Model preparation
- Statcast features
k_rate_regression.py - K-rate model
k_rate_model.pkl - Example data
example_pybaseball.csv
Other components
- Analyst
- The Odds API
- Pybaseball
Connections 13
- Analyst → Odds collector: requests odds
- Odds collector → The Odds API: fetches prices
- Odds collector → Odds snapshots: saves snapshots
- Prop simulation → Odds snapshots: reads latest lines
- Prop simulation → Odds collector: loads snapshot helper
- Analyst → Prop simulation: runs simulations
- Analyst → Stats and results: runs data pulls
- Stats and results → Pybaseball: fetches stats
- Stats and results → Player identity: uses player IDs
- Analyst → Bet backtesting: runs backtest
- Analyst → Outcome distributions: plots outcomes
- Analyst → Statcast features: builds features
- Statcast features → Pybaseball: pulls Statcast