Chapter 14: Exercises - Player and Team Comparison Charts
Exercise Overview
These exercises build skills in creating effective comparison visualizations for football analytics. Progress from basic comparisons to complex multi-entity analysis.
Level 1: Conceptual Understanding
Exercise 1.1: Comparison Type Classification
For each scenario below, identify the appropriate comparison type and justify your choice:
a) Comparing a quarterback's 2023 vs 2024 statistics b) Ranking all SEC running backs by yards per carry c) Showing how four teams perform across offensive, defensive, and special teams metrics d) Tracking weekly AP Poll rankings for top 10 teams e) Comparing a recruit to current roster players
Answer Framework: | Scenario | Comparison Type | Justification | |----------|-----------------|---------------| | a | | | | b | | | | c | | | | d | | | | e | | |
Exercise 1.2: Chart Type Selection
Match each visualization need to the most appropriate chart type:
- Show 12 teams' performance across 6 metrics simultaneously
- Compare two QBs' stats with their percentile ranks
- Show how conference standings changed week by week
- Display improvement in rushing yards from Week 1 to Week 12
- Rank 25 teams by defensive EPA
Chart Options: A. Horizontal bar chart B. Radar chart comparison C. Bump chart D. Slope chart E. Dumbbell chart
Exercise 1.3: Fairness Analysis
Identify the fairness issues in these comparison scenarios:
a) Comparing a starter's total yards to a backup's yards per game b) Ranking players by touchdowns without adjusting for games played c) Comparing a 2024 quarterback to a 1990 quarterback using raw passing yards d) Creating a radar chart using only metrics where one player excels
Level 2: Implementation Basics
Exercise 2.1: Simple Ranking Bar Chart
Create a horizontal bar chart ranking SEC teams by points per game:
teams = ['Georgia', 'Alabama', 'LSU', 'Tennessee', 'Ole Miss',
'Texas A&M', 'Kentucky', 'Missouri', 'Florida', 'Auburn',
'South Carolina', 'Arkansas', 'Mississippi State', 'Vanderbilt']
ppg = [38.2, 35.8, 34.1, 32.5, 31.8, 28.4, 26.1, 25.8, 25.2,
24.1, 23.5, 22.8, 21.4, 18.9]
conference_avg = 27.3
Requirements: - Sort from highest to lowest - Add conference average reference line - Highlight top 3 teams - Include value labels
Exercise 2.2: Basic Radar Chart
Create a radar chart for this quarterback:
metrics = ['Completion %', 'Yards/Att', 'TD Rate', 'INT Rate (inv)',
'Rush Yards', 'Sack Rate (inv)']
# Values normalized to 0-100 scale (higher is better)
qb_stats = {
'Completion %': 72,
'Yards/Att': 85,
'TD Rate': 68,
'INT Rate (inv)': 88, # Already inverted: 100 = no interceptions
'Rush Yards': 45,
'Sack Rate (inv)': 62
}
Requirements: - Proper polar projection - Filled area with transparency - Clear metric labels - Appropriate title
Exercise 2.3: Dumbbell Chart
Create a dumbbell chart showing offensive improvement:
teams = ['Georgia', 'Ohio State', 'Alabama', 'Michigan', 'Texas']
# EPA per play
epa_first_half = [0.15, 0.22, 0.18, 0.12, 0.08]
epa_second_half = [0.28, 0.19, 0.24, 0.21, 0.22]
Requirements: - Color connectors based on improvement direction (green for up, red for down) - Show change magnitude labels - Sort by improvement amount
Level 3: Intermediate Applications
Exercise 3.1: Multi-Player Radar Comparison
Create a radar chart comparing three running backs:
metrics = ['Yards/Carry', 'TD Rate', 'YAC/Carry', 'Broken Tackles/Att',
'Receiving Yards', 'Pass Block Grade', 'Fumble Rate (inv)']
players = {
'Bijan Robinson': {
'Yards/Carry': 92,
'TD Rate': 78,
'YAC/Carry': 88,
'Broken Tackles/Att': 95,
'Receiving Yards': 82,
'Pass Block Grade': 71,
'Fumble Rate (inv)': 94
},
'Jahmyr Gibbs': {
'Yards/Carry': 85,
'TD Rate': 72,
'YAC/Carry': 91,
'Broken Tackles/Att': 76,
'Receiving Yards': 96,
'Pass Block Grade': 68,
'Fumble Rate (inv)': 89
},
'Devon Achane': {
'Yards/Carry': 88,
'TD Rate': 68,
'YAC/Carry': 94,
'Broken Tackles/Att': 72,
'Receiving Yards': 84,
'Pass Block Grade': 58,
'Fumble Rate (inv)': 92
}
}
Requirements: - Distinct colors for each player - Semi-transparent fills - Legend with player names - Professional styling
Exercise 3.2: Conference Bump Chart
Create a bump chart showing Big Ten standings:
weeks = ['Week 1', 'Week 4', 'Week 8', 'Week 12', 'Final']
standings = {
'Ohio State': [2, 1, 1, 2, 2],
'Michigan': [3, 2, 2, 1, 1],
'Penn State': [1, 3, 3, 3, 3],
'Wisconsin': [5, 4, 5, 4, 4],
'Iowa': [4, 5, 4, 5, 5],
'Minnesota': [7, 6, 6, 7, 6],
'Maryland': [6, 7, 8, 6, 7],
'Illinois': [8, 8, 7, 8, 8],
'Purdue': [10, 9, 9, 9, 9],
'Nebraska': [9, 10, 10, 10, 10]
}
Requirements: - Highlight top 3 teams with bold lines - Rank 1 at top of y-axis - Labels for highlighted teams - Gridlines for each rank position
Exercise 3.3: Grouped Bar Comparison
Create a grouped bar chart comparing teams across efficiency metrics:
teams = ['Georgia', 'Alabama', 'Ohio State', 'Michigan']
metrics = {
'Offensive EPA/Play': [0.22, 0.19, 0.24, 0.15],
'Defensive EPA/Play': [-0.18, -0.15, -0.12, -0.21], # Negative is good
'Special Teams EPA/Play': [0.04, 0.02, 0.01, 0.05]
}
Requirements: - Grouped bars for each team - Appropriate color scheme - Legend identifying metrics - Note that negative defensive EPA is positive for defense
Level 4: Advanced Techniques
Exercise 4.1: Percentile Profile Chart
Create a percentile profile visualization:
# Target player stats
player = "Caleb Williams"
player_stats = {
'Completion %': 66.8,
'Yards/Attempt': 9.2,
'TD Rate': 7.8,
'INT Rate': 2.1,
'QBR': 88.4,
'Adjusted Comp %': 78.2,
'Big Time Throw %': 6.4,
'Turnover Worthy Play %': 2.3
}
# Population distributions (all FBS QBs with 200+ attempts)
population = {
'Completion %': [58.2, 59.1, 60.4, ..., 72.3], # 130 values
'Yards/Attempt': [5.8, 6.1, ..., 10.2],
# ... etc
}
Requirements: - Horizontal bars showing percentile position (0-100 scale) - Color zones: red (<25), yellow (25-50), light green (50-75), dark green (>75) - Show raw value and percentile for each metric - 50th percentile reference line
Exercise 4.2: Similarity Heatmap and Dendrogram
Create clustering visualization for player similarity:
import numpy as np
players = ['Player A', 'Player B', 'Player C', 'Player D',
'Player E', 'Player F', 'Player G', 'Player H']
# Feature matrix (8 players x 6 metrics)
features = np.array([
[72, 8.5, 6.2, 2.1, 85, 120],
[65, 7.8, 5.8, 3.2, 72, 280],
[70, 8.2, 6.0, 2.4, 82, 150],
[64, 7.5, 5.5, 3.5, 68, 310],
[71, 8.4, 6.1, 2.2, 84, 130],
[63, 7.2, 5.2, 3.8, 65, 340],
[68, 7.9, 5.7, 2.8, 76, 220],
[66, 8.0, 5.9, 2.6, 78, 190]
])
Requirements: - Create similarity heatmap (8x8 grid) - Create dendrogram showing hierarchical clustering - Use ward linkage method - Identify natural clusters
Exercise 4.3: Small Multiples by Conference
Create small multiples showing rushing yards distribution by conference:
conferences = {
'SEC': [rushing_yards for 40 players],
'Big Ten': [rushing_yards for 35 players],
'Big 12': [rushing_yards for 32 players],
'ACC': [rushing_yards for 38 players],
'Pac-12': [rushing_yards for 30 players]
}
# Reference: FBS average = 485 yards
fbs_average = 485
Requirements: - 5 histogram subplots (1 row, 5 columns) - Consistent x-axis range across all plots - FBS average reference line - Conference mean marked in each plot - Clear conference labels
Level 5: Professional Applications
Exercise 5.1: Complete Player Comparison Dashboard
Build a multi-panel dashboard comparing two quarterbacks:
Data Provided: - Player statistics (15 metrics each) - Population distributions for percentile calculations - Game-by-game trends (12 games each) - Situational splits (by down, by quarter)
Required Panels: 1. Radar chart overlay 2. Metric-by-metric bar comparison 3. Percentile comparison chart 4. Season trend comparison (line chart) 5. Situational efficiency heatmap comparison
Design Requirements: - Consistent color scheme (Player A: blue tones, Player B: red tones) - Professional typography - Clear titles for each panel - Cohesive layout with proper spacing
Exercise 5.2: Recruiting Comparison Tool
Create visualization for comparing a recruit to current roster players:
Data:
recruit = {
'name': 'Arch Manning',
'position': 'QB',
'height': 76, # inches
'weight': 215,
'arm_strength': 92, # 0-100 rating
'accuracy': 88,
'mobility': 75,
'football_iq': 90,
'leadership': 95
}
roster_qbs = [
{'name': 'Quinn Ewers', 'height': 74, 'weight': 210, ...},
{'name': 'Maalik Murphy', 'height': 76, 'weight': 230, ...},
{'name': 'Cole Lourd', 'height': 73, 'weight': 195, ...}
]
Required Visualizations: 1. Radar chart: recruit vs roster average 2. Bar chart: where recruit ranks on each attribute 3. Similarity scores: which roster player is most similar 4. Gap analysis: where recruit exceeds/trails roster
Exercise 5.3: Conference Power Rankings Dashboard
Create an interactive-style static dashboard showing conference comparisons:
Components: 1. Bump chart: Top 10 teams across weekly polls 2. Diverging bar chart: Conference aggregate EPA vs FBS average 3. Small multiples: Each conference's offensive vs defensive efficiency 4. Stacked bars: Conference breakdown by team tier (Elite/Good/Average/Below)
Requirements: - Publication-quality design - Cohesive visual theme - Comprehensive annotations - Data source citations
Challenge Exercises
Challenge A: Fair Comparison System
Design a comparison system that automatically adjusts for: - Games played - Opponent strength - Home/away splits - Weather conditions
Create visualizations that clearly communicate both raw and adjusted values.
Challenge B: Historical Player Comparison
Build a system to compare players across different eras: - Era adjustment factors for passing stats (1980 vs 2020) - Visualization showing both raw and era-adjusted comparisons - Uncertainty ranges reflecting adjustment imprecision
Challenge C: Transfer Portal Analytics
Create comparison visualizations for transfer portal analysis: - Player production at previous school - How similar players have performed after transferring - System fit analysis (player style vs new team's offensive scheme) - Uncertainty in projections
Submission Checklist
For each exercise, ensure your submission includes:
- [ ] Complete Python code with comments
- [ ] Generated visualization file (.png or .pdf)
- [ ] Brief description of design choices
- [ ] Discussion of any limitations or caveats
- [ ] For Level 4+: Alternative approaches considered
Grading Criteria
| Criterion | Weight |
|---|---|
| Technical correctness | 25% |
| Visual clarity | 25% |
| Comparison fairness | 20% |
| Code quality | 15% |
| Design aesthetics | 15% |