Inspiration

Most sports analytics projects follow the exact same format: download a dataset, train a model, make a chart, and call it a day. They don't reflect how real analytics departments at top-tier cricket organizations actually work. We wanted to build something that mirrors a true production engineering environment—focusing not just on the machine learning model, but on robust data pipelines, scalable architecture, and intelligent AI integration.

What it does

CricketIQ (CRICKETANALYSER) is a production-grade sports analytics system that ingests International Cricket Ball Tracking data and processes it through a Medallion Data Architecture (Bronze/Silver/Gold).

It features two major analytical engines:

  1. Predictive Machine Learning: An XGBoost model that predicts a bowler's next-match effectiveness by calculating their expected "Dot Ball Percentage" (which we found to be the most stable indicator of bowler quality).
  2. AI-Powered Scouting Reports: An enrichment layer powered by LLaMA-3 (via Groq API) that reads the structured statistical outputs and generates human-readable scouting narratives, highlighting anomalies and key findings.

All of this is wrapped in a beautiful, glassmorphic dark-themed Streamlit dashboard for easy exploration.

How we built it

We architected the system using a tiered approach:

  • Bronze Layer: Raw ball-tracking event data is saved immutably as Parquet files.
  • Silver Layer: Data is loaded into DuckDB for lightning-fast, vectorized SQL transformations, cleaning, and window-function feature engineering.
  • Gold Layer: Fully aggregated analytical datasets (bowler summaries, batsman trends) exported as Parquet.
  • ML Layer: We trained an XGBoost Regressor using TimeSeriesSplit cross-validation (to prevent data leakage) and used SHAP values to explain the model's predictions.
  • LLM Layer: We used Groq to generate fast scouting reports without ever using the LLM as a calculator, ensuring complete auditability.
  • Frontend: A Streamlit dashboard styled with custom CSS to give it a premium, hackathon-winning aesthetic.

Challenges we ran into

  1. Data Leakage in ML: When using time-series sports data, standard k-fold cross-validation allows the model to "cheat" by training on future matches. We had to strictly enforce a TimeSeriesSplit to ensure the model only ever learned from the past.
  2. LLM Hallucinations: Initially, we tried having the LLM compute statistics, which led to incorrect numbers. We solved this by strictly separating computation from synthesis: DuckDB calculates every stat deterministically, and the LLM only writes the narrative.

Accomplishments that we're proud of

  • Replacing Pandas with DuckDB for our analytical aggregations, which reduced query times from 8-12 seconds down to ~400ms.
  • Successfully implementing a true Bronze/Silver/Gold data architecture in a hackathon timeframe.
  • Designing a gorgeous, responsive UI that goes far beyond standard Streamlit defaults.

What we learned

  • Domain Knowledge > Complex Math: Understanding that Dot Ball Percentage stabilizes faster and predicts future success better than raw Economy Rate made our ML model significantly more useful.
  • Stateless Pipelines: Keeping the pipeline stateless by reading and writing directly to Parquet makes the system incredibly resilient.

What's next for CricketIQ

  • Real-time Ingestion: Replacing the batch Ball Tracking pull with a live web-socket feed during live matches.
  • Opponent-Adjusted Metrics: Factoring in the opposing lineup's quality to adjust Dot Ball Percentage projections dynamically.
  • Bullpen Analytics: Extending the model to handle relief bowlers, factoring in high-leverage situations and inherited batsmen.

Built With

Share this project:

Updates

Submission history