Capstone Project Brief — Cricket Analytics Platform
Welcome to Module 6 — the Capstone. Over Lessons 32–35 you will build a complete Cricket Analytics Platform that integrates every major technique from this course: regression, classification, clustering, anomaly detection, preprocessing pipelines, model evaluation, and cross-validation. You will not receive pre-written code. Each phase presents a problem brief and starter code; you solve it, validate your solution, and progress to the next phase. This mirrors how a professional ML engineer delivers a project.
The platform serves a fictional IPL franchise analytics team. Management has three requests: (1) predict the final score a batting team will reach given match conditions and current run rate — a regression task; (2) predict match outcome (win/loss) given first-innings data — a classification task; (3) segment players into performance archetypes for squad planning — a clustering task. Each phase builds on the previous, and the final submission in Lesson 35 asks you to document design decisions, limitations, and business recommendations.
Project Structure — Four Phases
Phase 1 (Lesson 32) — Regression: Predicting Match Scores. You will train regression models to predict the final total runs from mid-innings features, compare at least two algorithms (Linear Regression and Random Forest Regressor), evaluate with RMSE and R², and explain which features drive score predictions using feature importance or permutation importance.
Phase 2 (Lesson 33) — Classification: Predicting Match Outcomes. Using first-innings data you will build a classifier to predict the second-innings team's win probability. You must handle class imbalance if present, tune at least one hyperparameter via GridSearchCV, and report precision, recall, F1, and ROC-AUC for the positive class.
Phase 3 (Lesson 34) — Clustering: Player Segmentation. You will apply K-Means and at least one alternative (agglomerative or DBSCAN), choose K using the Elbow and Silhouette methods, visualise with PCA, and produce a named archetype profile table for the franchise coach. Bonus: run Isolation Forest to flag statistical anomalies in the player dataset.
Phase 4 (Lesson 35) — Final Submission and Course Reflection. You will consolidate all three models into a single evaluation report, reflect on design decisions (algorithm choices, hyperparameter tuning, limitations), propose two improvements that a production deployment would require, and write a one-page executive summary for a non-technical franchise director.
Shared Dataset — IPL Synthetic Match Records
# ─── RUN THIS CELL FIRST IN EVERY CAPSTONE LESSON ────────────────────────────
# Shared data generator — produces consistent synthetic IPL datasets
import numpy as np
import pandas as pd
np.random.seed(2024)
# ── Match-level dataset (600 T20 matches) ─────────────────────────────────────
N_MATCHES = 600
venue_effect = {'Wankhede': 5, 'Eden Gardens': 3, 'Chinnaswamy': 8,
'Chepauk': -4, 'Feroz Shah Kotla': -2, 'Others': 0}
venues = np.random.choice(list(venue_effect.keys()), N_MATCHES)
matches = pd.DataFrame({
'match_id' : range(N_MATCHES),
'venue' : venues,
'toss_winner_bats' : np.random.binomial(1, 0.55, N_MATCHES), # 55% bat first
'powerplay_runs' : np.random.normal(52, 8, N_MATCHES).clip(30, 80).astype(int),
'powerplay_wickets': np.random.binomial(4, 0.3, N_MATCHES),
'run_rate_10' : np.random.normal(8.5, 1.2, N_MATCHES).clip(5, 13),
'wickets_at_10' : np.random.binomial(5, 0.35, N_MATCHES),
'top_order_avg' : np.random.normal(32, 10, N_MATCHES).clip(10, 60),
'team_batting_rank': np.random.randint(1, 9, N_MATCHES),
})
# Target: final score — correlated with run rate and venue
matches['final_score'] = (
matches['run_rate_10'] * 16 +
matches['powerplay_runs'] * 0.6 +
matches['venue'].map(venue_effect) +
np.random.normal(0, 12, N_MATCHES)
).clip(100, 250).astype(int)
# Target: match won by second innings team (outcome)
logit = (
0.04 * matches['final_score'] -
0.3 * matches['powerplay_wickets'] +
np.random.normal(0, 0.5, N_MATCHES)
)
matches['target_won'] = (1 / (1 + np.exp(-logit + 7)) > 0.5).astype(int)
print(f"Match dataset: {matches.shape}")
print(matches[['powerplay_runs','run_rate_10','final_score','target_won']].describe().round(2))
# ── Player-level dataset (300 players) ────────────────────────────────────────
N_PLAYERS = 300
players = pd.DataFrame({
'player_id' : range(N_PLAYERS),
'batting_avg' : np.random.normal(27, 14, N_PLAYERS).clip(0),
'strike_rate' : np.random.normal(128, 28, N_PLAYERS).clip(60, 220),
'bowling_economy' : np.random.normal(8.2, 2.1, N_PLAYERS).clip(4, 15),
'wickets_per_game': np.random.exponential(0.7, N_PLAYERS),
'catches_per_game': np.random.exponential(0.4, N_PLAYERS),
'sixes_per_innings': np.random.exponential(1.2, N_PLAYERS),
'dot_ball_pct' : np.random.normal(0.35, 0.12, N_PLAYERS).clip(0, 0.7),
'matches_played' : np.random.randint(5, 80, N_PLAYERS),
})
print(f"\nPlayer dataset: {players.shape}")
print(players.describe().round(2))
Grading Rubric
Phase 1 (25 pts): correct Pipeline, ≥2 regressors compared, RMSE and R² reported, feature importance visualised. Phase 2 (25 pts): ≥1 classifier, GridSearchCV tuning, precision/recall/F1/ROC-AUC reported, confusion matrix shown. Phase 3 (25 pts): ≥2 clustering algorithms, K chosen with Elbow+Silhouette, PCA visualisation, named segment profile table. Phase 4 (25 pts): consolidated report, limitations identified, two production improvements proposed, executive summary written. Total: 100 points.
💡 All three phases share the same data generator cell above. Run it at the top of each lesson notebook so all downstream code has access to the same `matches` and `players` DataFrames. The random seed is fixed at 2024 — your results should be reproducible.
- The capstone integrates regression (Lesson 32), classification (Lesson 33), clustering (Lesson 34), and a final reflection (Lesson 35).
- All phases share a common synthetic IPL dataset — run the shared data generator cell first in every lesson.
- Each phase requires at least two algorithms to be compared, not just one, mirroring professional practice.
- Final grading is equally weighted: 25 points per phase; Phase 4 rewards documented reasoning and business communication.
- The executive summary in Phase 4 must be written for a non-technical audience — avoid jargon, focus on actionable insights.