video video |
|---|
π Sports Betting Profiling β Exploratory Data Analysis (EDA)
This project analyzes a large-scale sports betting dataset using Exploratory Data Analysis (EDA).
The goal is to understand user betting behavior, identify patterns, detect anomalies, and prepare the data for a classification model predicting whether a bet will win (is_win = True/False).
π Dataset Overview
- Rows: 100,000
- Columns:
bet_id,user_id,bet_type,sport,odds,is_win,stake,gain,GGR - Each row represents one bet placed by a user.
Main Variables:
- stake: How much money the user bet
- odds: Decimal odds of the event
- is_win: Whether the bet won
- gain: The payout received
- GGR: Gross Gaming Revenue (platform profit/loss)
π§Ή Data Cleaning
The following steps were performed:
β Missing Values
- No missing values found (
df.isnull().sum()).
β Duplicate Rows
- No duplicate rows were detected.
β Data Types
- Converted numerical columns (
odds,stake,gain,GGR) to float. - Converted
is_winto boolean. - Standardized category formatting (e.g. trimming spaces, title-casing sports).
β Normalization (for modeling)
- Standard scaling applied to
stake,gain, andoddsfor improved numerical stability.
π Outlier Detection & Handling
Outliers were detected using:
- Box plots
- IQR Rule (Q1β1.5Β·IQR, Q3+1.5Β·IQR)
Findings:
stake,gain, and especiallyGGRcontained extreme values.- Example:
GGRranged from -20,595 to +999.95. - A small number of extremely large negative gains were removed to prevent distortion.
Decision:
β‘ Realistic high-stake bets were kept.
β‘ Only statistically extreme outliers were removed.
π Descriptive Statistics
Key Numeric Columns (df.describe())
| Metric | Stake | Gain | Odds | GGR |
|---|---|---|---|---|
| Mean | 132.63 | 119.29 | 4.70 | 13.34 |
| Median | 83.00 | 0.00 | 3.05 | 20.30 |
| Std | 260.93 | 294.38 | 4.36 | 399.96 |
| Min | 0.00 | 0.00 | 1.01 | -20,595.23 |
| Max | 10,000.00 | 9,995.00 | 51.00 | 999.95 |
Interpretation:
- Stake is extremely right-skewed β most bets are small, but a few go up to 10,000.
- Gain has median = 0 β meaning most bets are losing bets.
- Odds vary widely, but most are midβlow.
- GGR strongly negative for winning bets, as expected.
π₯ Correlation Analysis
Here is the actual correlation matrix:
| Variable | is_win | stake | gain | odds | GGR |
|---|---|---|---|---|---|
| is_win | 1.00 | 0.00 | 0.37 | -0.38 | -0.39 |
| stake | 0.00 | 1.00 | 0.33 | 0.00 | 0.03 |
| gain | 0.37 | 0.33 | 1.00 | 0.03 | -0.93 |
| GGR | -0.39 | 0.03 | -0.93 | -0.03 | 1.00 |
Insights:
- Winners (
is_win=True) produce large gains β positive correlation (0.37) - Odds are NEGATIVELY correlated with winning (-0.38)
- Huge negative correlation between Gain and GGR (-0.93)
- When users win big β platform loses big.
π Visualizations
1οΈβ£ Stake Distribution
(stake_hist.png)
Shows a right-skewed curve: many small bets, few very large bets.
2οΈβ£ Stake vs Gain (colored by win)
(stake_vs_gain_scatter.png)
Winning bets produce sharply higher gains; losing bets cluster at zero.
3οΈβ£ Gain Boxplot
(gain_boxplot.png)
Reveals many high-gain outliers and non-normal distribution.
4οΈβ£ Correlation Heatmap
(correlation_heatmap.png)
Highlights relationships described above.
β Key Questions & Answers
1. Which sports are the most popular?
Football is the most bet-on sport, followed by Tennis and Basketball.
2. Do higher stakes lead to higher gains?
Yes β but only for winning bets.
Losing bets result in zero gain regardless of stake size.
3. Are multiple bets riskier?
Yes β they win less often but can pay more when successful.
4. How does user winning affect platform revenue (GGR)?
Strong negative correlation (β0.39):
When users win, GGR decreases sharply.
5. What features seem useful for classification?
oddsstakesportbet_typegain(for historical training only)
π― Classification Goal
Using the insights above, the target ML problem is:
Predict whether a bet will win (is_win) using features like odds, stake, bet_type, and sport.
This is a binary classification problem.
π Files Included
| File | Description |
|---|---|
bets.csv |
Raw dataset |
sports_betting_EDA.ipynb |
Full EDA notebook |
stake_hist.png |
Histogram of stake distribution |
stake_vs_gain_scatter.png |
Scatter plot of stake vs gain |
gain_boxplot.png |
Boxplot for gain |
correlation_heatmap.png |
Heatmap of correlations |
README.md |
This report |
π How to Reproduce
- Download this dataset from HuggingFace
- Open the notebook in Google Colab
- Run all cells
- Visualizations and insights will be generated automatically
β Final Notes
This dataset provides strong signals that can be used to build a predictive model for bet outcomes.
Insights from the EDA reveal behavioral patterns, risk profiles, and important relationships in sports betting.
- Downloads last month
- 100