This project implements a quantitative betting strategy for horse racing, specifically targeting Trio bets. It utilizes the Shin model for probability estimation, a Discount Model for calculating trio probabilities, and the Kelly Criterion for optimal staking.
processData.py: The main data pipeline script. It reads raw race results fromrace_results/and trio odds fromtrio_odds/, processes them (normalizing odds, identifying winning combinations), and outputs a consolidated dataset todata.csv.
-
Strategy.py: Contains the core logic for the betting engine.-
Shin Model: Estimates "true" win probabilities from market odds, accounting for the insider trading bias (
$z$ ). - Discount Model: Calculates the probability of a specific Trio combination (1st, 2nd, 3rd in any order) based on win probabilities.
- Kelly Criterion: Calculates optimal bet sizes to maximize logarithmic wealth growth while managing risk.
-
Shin Model: Estimates "true" win probabilities from market odds, accounting for the insider trading bias (
train.py: Implements a PyTorch Multi-Layer Perceptron (MLP) (OddsPredictor) to predict trio odds or probabilities based on normalized win odds. This suggests a research direction into improving probability estimates beyond the standard Shin model.
scraper_.py&trio_scraper.py: Scripts responsible for scraping race results and odds data (likely from a racing authority website).
data.csv: The primary dataset used for analysis and training.race_results/: Directory containing individual CSV files for race results.trio_odds/: Directory containing individual CSV files for trio odds.
- Data Prep: Run
python processData.pyto updatedata.csvfrom raw files. - Strategy Execution:
Strategy.pycan be run to generate recommendations for a specific set of odds (see__main__block in the file). - Training: Run
python train.pyto train the odds prediction model.