This project explores whether machine learning models can predict betting odds and betting risk levels from historical WTA tennis statistics.
Using a large-scale dataset (2007–2023), we built regression and classification models to understand how ranking, performance gaps, match context, and engineered features shape betting market behavior.
The final goal: Can historical match statistics help identify betting patterns and support decision-making in real time?
1. Dataset Overview
Dataset used: WTA Tennis 2007–2023 Daily Update Size: ~50,000 matches
Features extracted:
Player rankings (Rank_1, Rank_2)
Player points (Pts_1, Pts_2)
Betting odds (Odd_1, Odd_2)
Match attributes (Surface, Round)
Engineered features:
Feature
Description
Rank_Diff
Rank_1 − Rank_2 (competitive gap)
Pts_Diff
Pts_1 − Pts_2 (performance gap)
Favorite_Flag
1 if Odd_1 < Odd_2
Cluster_Label
K-Means cluster based on ranks and points
These features proved essential for improving model performance.
2. Exploratory Data Analysis (EDA)
We started by exploring the distribution of betting odds and competitive gaps.
2.1 Distribution of Pre-Match Odds (Odd_1)
Distribution of Odd_1
This plot shows that:
Most matches have low odds for Player 1 (strong favorites).
There is a long tail of higher odds representing clear underdogs.
2.2 Distribution of Ranking Difference (Rank_Diff)
Distribution of Rank_Diff
Interpretation:
Many matches are played between players with small rank differences.
Large positive or negative gaps are less common but very influential in betting.
2.3 Relationship Between Ranking Gap and Odds
Rank_Diff vs Odd_1
This scatter plot shows:
A clear relationship between Rank_Diff and Odd_1.
When Player 1 is much stronger (large negative Rank_Diff), Odd_1 tends to be lower.
When Player 1 is weaker (positive Rank_Diff), Odd_1 increases.
This confirms that ranking gaps are a key driver of betting odds.
2.4 Odds by Surface
Odd_1 by Surface
We see that:
Odds distributions differ slightly across Hard, Clay, and Grass.
Some surfaces exhibit higher variance in odds, reflecting different levels of uncertainty.
3. Feature Engineering
We engineered several features to improve predictive power:
✔ Rank_Diff & Pts_Diff
Capture performance gaps between players — strong predictors of market expectations.
✔ Favorite_Flag
Binary indicator:
1 → Player 1 is the pre-match favorite (Odd_1 < Odd_2)
0 → Player 1 is the underdog
✔ Cluster_Label (K-Means)
K-Means clustering on:
Rank_1, Rank_2, Pts_1, Pts_2
This groups matches into tiers (balanced, uneven, elite matchups) and adds a latent “match type” signal to the model.
All engineered features were inspected visually and statistically before modeling.
Rank_Diff and Pts_Diff are among the most important predictors.
Cluster-based features (Cluster_Label) and favorite information (Favorite_Flag) also contribute significantly.
Why Gradient Boosting Won:
Best R² score
Lowest errors (MAE/RMSE)
Handles nonlinear tennis behavior better than linear models
The final regression model is saved as: winning_regression_model.pkl
5. Converting Regression to Classification
To create a classification problem, we transformed Odd_1 into three balanced classes using quantiles:
Low_Odds — strong favorites
Medium_Odds — balanced matches
High_Odds — clear underdogs
This created a well-balanced classification setup where each class has a similar number of samples.
We also discussed:
Recall vs Precision:
Recall is more important, because missing a high-value opportunity (false negative) is more costly than marking a match as risky when it is not.