100% Free Forever
AI-Powered Learning
Industry Expert Content
Certificates & Badges
Learn At Your Own Pace
Machine Learning with Scikit-learn
20 minintermediate

Capstone Project Brief — Cricket Analytics Platform

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.

Analogy🏏Cricket
🏏 Think of it like cricket: a franchise's data team is preparing for the IPL mega-auction. The head coach wants three tools on his tablet: a score-predictor that tells him how many runs the opposition will likely post given their current position, a win-probability calculator that shows his team's chances after the first innings, and a player-archetype dashboard that segments all 300 shortlisted players into tactical categories so the scouts know which gaps in the squad to fill. You are building all three tools using the ML skills you have developed across Courses 3 and 4.

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.

Analogy🏏Cricket
🏏 Think of it like cricket: this capstone is structured like planning a whole tournament campaign in four phases. Just as an analyst's first job is forecasting how many runs an innings will finish on from its mid-way position, Phase 1 has you build regression models predicting final total runs from mid-innings features — comparing at least Linear Regression and a Random Forest Regressor, judging them on RMSE and R², and naming which features drive the score via importance analysis. Just as you'd later shift from predicting totals to calling who wins, the remaining phases move from regression into classification, clustering, and a consolidated report. Just as a captain compares two bowling plans before committing to one, comparing at least two algorithms per phase and reporting honest metrics is what separates a guess from an analysis. Laying the campaign out in clear phases means each modelling skill you've learned gets its own proving ground, and the whole project reads as one coherent analytics story.

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

python
# ─── 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.

Analogy🏏Cricket
🏏 Think of it like cricket: the rubric is the scorecard that decides your final grade, with 25 points riding on each of four innings. Just as Phase 1 rewards a proper Pipeline, two or more regressors compared, RMSE and R² reported, and feature importance shown, Phase 2 demands a classifier with GridSearchCV tuning plus precision, recall, F1 and ROC-AUC and a confusion matrix. Just as a batting side must post runs in every session to win, you must deliver in all four phases — Phase 3 wants two clustering algorithms, K chosen by Elbow and Silhouette, a PCA visualisation and a named-segment profile table, and Phase 4 a consolidated report with limitations. Just as a captain who bats brilliantly but bowls carelessly still loses the match, excelling in one phase can't rescue neglect in another — the 25-point blocks force balance across the whole skill set. Reading the rubric first is like knowing the target before you bat: every deliverable you tick off is runs banked toward the win.

💡 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.
Lesson 31 of 35
0% complete