AI

HACK DAY: NBA Predictive Modelling with XGBoost

Jared Brook

3 Minute Read

Every six weeks, our global team gathers for HackDay to innovate in software development. With focused goals, our team collaborate to push boundaries and deliver exceptional value to our customers.

This time our team dove into the world of sports analytics by building a predictive model for NBA game outcomes using XGBoost decision trees. This project provided a hands-on exploration of how machine learning can be applied to real-world problems and in this case, basketball. 

To power the model, we sourced four years of historical data via the NBA API, with the aim of predicting outcomes for this year’s games. The dataset totalled roughly 60,000 rows per season. Throughout the process, we tackled key challenges such as API rate limits and managing large volumes of data, refining our understanding of the end-to-end data science workflow.

Feature Engineering That Drives Insight

Our modelling approach placed strong emphasis on feature engineering. Key variables used included:

  • Win streaks (particularly away win streaks)
  • Team performance metrics
  • Game outcomes
  • Box scores
  • Home or away game status
  • Which players were on court

By experimenting with combinations of these features, the model could intelligently identify the most predictive attributes with away win streaks emerging as a top indicator for forecasting results.

XGBoost was chosen for its performance, ease of use, interpretability and visual outputs. It helped us understand how predictions were generated through a decision tree structure as depicted below:

Click on the image for a clearer view


XGBoost Decision Tree NBA

 

Real Results and Real Learning

The final model achieved nearly 80% accuracy, a promising result in the volatile world of professional sports. However, we also recognised its limitations including outdated player stats and season-to-season variability in team dynamics. These issues spurred conversations around model reliability and the importance of timely data.

Beyond the Model

The real value of this project wasn’t just in the model’s predictions, but in the critical thinking and collaboration it inspired. From optimising team performance to informing smarter player selection strategies, we uncovered a wealth of potential real-world applications. Moreover, to bring the project full circle, we even built a web interface to visualise the results making the insights accessible and interactive.


Screen Shot 2025-05-15 at 2.35.24 pm


Curiosity, resilience and a growth mindset turned this project into more than a technical exercise. It became a blueprint for how data can shape innovation in any field. 

Ready to Take the Shot?

base2Services, turns complex data challenges into smart, scalable solutions. Whether you're exploring AI, automating workflows, or building predictive models, we help you move from insight to impact with confidence. Discover the power of AI for your business here. 



More Blog Posts