An end-to-end Machine Learning pipeline designed to predict game outcomes for both the Men's (MNCAA) and Women's (WNCAA) Basketball Tournaments. By combining historical tournament seeds, regular-season performance metrics, and advanced scoring differentials, this project trains an optimized XGBoost classifier to estimate the probability of match victories.
March Madness is famous for its unpredictability. The goal of this project is to model and predict the probability of team victory in tournament matchups by:
- Unifying Data: Merging historical regular-season and tournament game logs for both men's and women's divisions.
- Feature Engineering: Designing strong baseline estimators based on seed advantages, scoring power, and defensive resilience.
- Optimized ML Modeling: Implementing an XGBoost pipeline utilizing imputation and scaling, validated via robust cross-validation.
Rather than passing raw scores which are unavailable at prediction time, the model relies on seasonal aggregated stats. Three primary features are calculated for each matchup (
| Feature | Description | Strategic Representation |
|---|---|---|
SeedDiff |
Captures tournament-ranking disparity. | |
AvgPointsDiff |
Captures offensive strength and scoring efficiency. | |
AvgPointsAllowedDiff |
Captures defensive resilience and suppression ability. |
Note: Team order is normalized ($Team_1 < Team_2$ based on ID) to ensure order-invariant predictions.
The model utilizes a Scikit-Learn Pipeline for clean preprocessing and training isolation:
- Mean Imputer: Handles missing or new team stats with baseline averages.
- Standard Scaler: Normalizes feature scales for reliable learning.
- XGBoost Classifier: Configured with light regularization:
max_depth=3(to prevent overfitting on high seed/point variance)learning_rate=0.1n_estimators=100
The pipeline evaluates model generalizability across 5 folds, preserving target class distributions.
- 📉 Average Log Loss:
0.5027 - 🎯 Average Brier Score:
0.1677 - 📉 Average Mean Squared Error (MSE):
0.1677 - 📈 Average ROC AUC:
0.8312
.
├── NTLML_NACC_Tournment.ipynb # The core Jupyter Notebook / pipeline runner
├── README.md # Project documentation (You are here!)
└── submission1.csv # Final probability predictions for submission
Install the required packages using pip:
pip install pandas numpy scikit-learn matplotlib xgboostThe notebook expects data to be organized in a directory structure (typically in Google Drive for Colab runtimes). Ensure files from the Kaggle March Madness dataset are present:
MNCAATourneySeeds.csv&WNCAATourneySeeds.csvMRegularSeasonDetailedResults.csv&WRegularSeasonDetailedResults.csvMNCAATourneyDetailedResults.csv&WNCAATourneyDetailedResults.csvSampleSubmissionStage1.csv
You can execute the pipeline directly in the notebook:
- Open
NTLML_NACC_Tournment.ipynbin your notebook editor (Google Colab or Local Jupyter). - Configure the directory path:
predictor = TournamentPredictor(data_dir="/path/to/your/NACC-DATA_2025/**")
- Run all cells. The pipeline will automatically load datasets, extract features, train with cross-validation, plot evaluation graphs, and generate
submission1.csv.