Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 

Repository files navigation

🏆 NCAA Tournament Prediction Pipeline

Python Version Scikit-Learn XGBoost Pandas

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.


📌 Project Overview & Purpose

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:

  1. Unifying Data: Merging historical regular-season and tournament game logs for both men's and women's divisions.
  2. Feature Engineering: Designing strong baseline estimators based on seed advantages, scoring power, and defensive resilience.
  3. Optimized ML Modeling: Implementing an XGBoost pipeline utilizing imputation and scaling, validated via robust cross-validation.

📊 Feature Engineering System

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 ($Team_1$ vs $Team_2$):

Feature Description Strategic Representation
SeedDiff $Team_1\text{ Seed} - Team_2\text{ Seed}$ Captures tournament-ranking disparity.
AvgPointsDiff $Team_1\text{ Avg Points Scored} - Team_2\text{ Avg Points Scored}$ Captures offensive strength and scoring efficiency.
AvgPointsAllowedDiff $Team_1\text{ Avg Points Allowed} - Team_2\text{ Avg Points Allowed}$ Captures defensive resilience and suppression ability.

Note: Team order is normalized ($Team_1 < Team_2$ based on ID) to ensure order-invariant predictions.


⚙️ Model & Evaluation Architecture

The model utilizes a Scikit-Learn Pipeline for clean preprocessing and training isolation:

  1. Mean Imputer: Handles missing or new team stats with baseline averages.
  2. Standard Scaler: Normalizes feature scales for reliable learning.
  3. XGBoost Classifier: Configured with light regularization:
    • max_depth=3 (to prevent overfitting on high seed/point variance)
    • learning_rate=0.1
    • n_estimators=100

Validation Strategy: 5-Fold Stratified K-Fold

The pipeline evaluates model generalizability across 5 folds, preserving target class distributions.

Performance Metrics Obtained:

  • 📉 Average Log Loss: 0.5027
  • 🎯 Average Brier Score: 0.1677
  • 📉 Average Mean Squared Error (MSE): 0.1677
  • 📈 Average ROC AUC: 0.8312

📁 Repository Structure

.
├── NTLML_NACC_Tournment.ipynb  # The core Jupyter Notebook / pipeline runner
├── README.md                   # Project documentation (You are here!)
└── submission1.csv             # Final probability predictions for submission

🚀 Setup & Execution Guide

Prerequisite Dependencies

Install the required packages using pip:

pip install pandas numpy scikit-learn matplotlib xgboost

Dataset Structure

The 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.csv
  • MRegularSeasonDetailedResults.csv & WRegularSeasonDetailedResults.csv
  • MNCAATourneyDetailedResults.csv & WNCAATourneyDetailedResults.csv
  • SampleSubmissionStage1.csv

Running the Predictor

You can execute the pipeline directly in the notebook:

  1. Open NTLML_NACC_Tournment.ipynb in your notebook editor (Google Colab or Local Jupyter).
  2. Configure the directory path:
    predictor = TournamentPredictor(data_dir="/path/to/your/NACC-DATA_2025/**")
  3. Run all cells. The pipeline will automatically load datasets, extract features, train with cross-validation, plot evaluation graphs, and generate submission1.csv.

About

An end-to-end Machine Learning pipeline utilizing XGBoost to predict match outcomes for both Men's (MNCAA) and Women's (WNCAA) Basketball Tournaments based on historical seeds and regular-season point differentials.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages