Hi, I'm Ashish Thorat, a 2nd-year B.Tech Computer Science student at A. C. Patil College of Engineering and a learner at NxtWave. This repository documents the machine learning pipeline I developed for the NxtWave AIPL Match Prediction competition.
The challenge was to predict the specific margin of victory for upcoming IPL matches across four classes:
A_small/A_big(Team A wins by a small/large margin)B_small/B_big(Team B wins by a small/large margin)
The evaluation metric was Multi-Class Log Loss. This is a critical factor because Log Loss heavily penalizes models that are highly confident but ultimately incorrect.
T20 cricket is inherently chaotic; a single dropped catch or rain delay can completely flip a match. Early in my research, I realized that building an overly complex model to chase high scores on the Public Leaderboard was a trap. Predicting a volatile sport with extreme confidence almost always leads to massive Log Loss penalties on unseen future data.
Rather than building an aggressive decision tree, my entire approach focused on variance reduction and defensive modeling.
Here is how I mathematically protected the model from overfitting to noise:
While exploring the data, I encountered a statistical trap: if a team plays exactly one match at a specific venue and wins, raw math gives them a 100% win rate. Feeding this to a model causes dangerous overconfidence. To fix this, I applied Laplace Smoothing (
I utilized a 10-Fold Stratified CatBoost Classifier because it natively handles categorical features (like team names and venues) very efficiently. However, I deliberately restricted its learning capacity:
- Depth = 2: Keeping the trees shallow forces the model to only learn undeniable, high-level trends rather than memorizing random match noise.
- L2 Regularization = 30: A severe penalty was applied to the leaf nodes to prevent the algorithm from ever outputting an overconfident prediction.
To absolutely guarantee the Log Loss score wouldn't explode during the Private Leaderboard evaluation, I calculated the exact historical base rate of the target classes across the entire dataset. During the final inference step, the script mathematically anchors the predictions—forcing them to be 80% based on the historical baseline, and only allowing the CatBoost model to shift the final probability by a maximum of 20%.
For historical matches, we know which team batted first. But for future IPL fixtures, the coin toss hasn't happened yet. To handle this missing variable without dropping the feature entirely, my script simulates both scenarios: it runs the prediction assuming Team A bats first, runs it again assuming Team B bats first, and mathematically averages the two probability distributions.
/data/: Contains the official competition CSV datasets (train_IPL.csv,public_lb_matches.csv,schedule.csv).AIPL_mark6.ipynb: The fully documented Jupyter Notebook containing the end-to-end pipeline (Data Cleaning → Laplace Smoothing → Training → Prior Anchoring → Output).submission_mark6.csv: The final probability matrix generated by the model.requirements.txt: Required Python dependencies.
- Clone this repository to your local machine.
- Install the required libraries:
pip install -r requirements.txt - Ensure the datasets are placed inside the
/data/folder. - Open
AIPL_mark6.ipynband execute the cells sequentially.