iTranslated by AI
Publishing the MLB Statcast + Bat Tracking Dataset (2024-2025) on Kaggle
Introduction
I have published a dataset on Kaggle that combines MLB 2024-2025 season Statcast data with Bat Tracking metrics.
What is Bat Tracking?
Bat Tracking is a measurement technology for hitting mechanics that MLB fully introduced in 2024. High-speed cameras measure the following metrics:
- bat_speed: Bat speed (mph) - The speed of the bat at the time of impact
- swing_length: Swing length (feet) - Shorter is more efficient
- swing_path_tilt: Swing path tilt (degrees) - Determines upward/downward swing
- attack_angle: Attack angle - The angle of the bat relative to the pitch trajectory
- attack_direction: Attack direction - Determines pull/opposite field contact
While conventional Statcast only provided "batted ball results (exit velocity, launch angle, etc.)," Bat Tracking now allows us to quantify the swing itself.
Dataset Overview
Basic Information
- Data Period: 2024-2025 regular season
- Number of Rows: 1,443,802 rows (approx. 1.44 million pitches)
- Number of Columns: 118 columns
- Size: 808MB
- Bat Tracking Coverage: Approx. 46.6% of pitches (approx. 670,000 pitches)
Key Columns
Bat Tracking Metrics
- bat_speed, swing_length, swing_path_tilt
- attack_angle, attack_direction
- intercept_ball_minus_batter_pos_x/y_inches
Statcast Metrics (Conventional)
- release_speed, spin_rate, movement (pfx_x, pfx_z)
- launch_speed, launch_angle, hit_distance_sc
- estimated_woba, estimated_ba_using_speedangle
- pitch_type, zone, description, events
Game Information
- game_date, game_type, inning, count (balls/strikes)
- player_name, batter, pitcher, stand, p_throws
- home/away score, win expectancy
Detailed descriptions of all 118 columns are provided in the Kaggle Column Description.
How to Obtain the Data
You can acquire it using the statcast() function of the pybaseball library. Bat Tracking metrics are automatically included.
from pybaseball import statcast
import pandas as pd
# 2024 Season
df_2024 = statcast(start_dt='2024-03-20', end_dt='2024-09-29')
# 2025 Season
df_2025 = statcast(start_dt='2025-03-27', end_dt='2025-09-28')
# Combine
df = pd.concat([df_2024, df_2025], ignore_index=True)
# Check Bat Tracking data
print(f"Bat tracking coverage: {df['bat_speed'].notna().sum() / len(df) * 100:.1f}%")
The data generation notebook is available to run on Google Colab:
Analysis Notebook
I have also published a basic analysis notebook using this dataset:
Analysis Content:
- Bat Tracking coverage analysis
- Distribution of Bat Speed / Swing Length / Swing Path Tilt
- Correlation between Bat Speed and Launch Speed
- Top 10 Bat Speed Leaders (by player)
- Bat Speed by pitch type
- Attack Angle/Direction heatmaps
Use Cases
Examples of analyses possible with this dataset:
1. Swing Mechanics Analysis
- Efficient swing paths (swing_length vs bat_speed)
- Effects of upward swings (swing_path_tilt vs launch_angle)
- Player ranking for fastest bat speed
2. Relationship with Pitching
- Which pitch types result in higher bat_speed
- Swing tendencies by count
- Relationship between location and attack_direction
3. Relationship with Batted Ball Results
- Conversion efficiency from bat_speed to launch_speed
- Relationship between swing_length and batting average
- Correlation between attack_angle and barrel rate
4. Player Development / Scouting
- Evaluating swing efficiency of draft prospects
- Tracking player swing improvements
- Analyzing opponent tendencies
Comparison with Other Datasets
Baseball datasets I have published previously:
-
Japanese MLB Players Statcast (2015-2025)
- Detailed data for 25 pitchers and 10 batters
-
MLB Bat Tracking Leaderboard (2024-2025)
- Season-level aggregated data by player (452 players)
-
MLB Pitcher Arsenal Evolution (2020-2025)
- Changes in pitcher pitch mix
Features of this dataset (the 4th one):
- pitch-by-pitch data
- Most detailed data including Bat Tracking metrics
- Large-scale dataset covering two seasons
Conclusion
Bat Tracking is a technology that adds a new dimension to baseball analysis. We can now quantify swings—which were previously only visible through "results"—as a "process."
I hope this dataset proves useful for research in baseball analytics, machine learning, and sports science.
Links
- Dataset: https://www.kaggle.com/datasets/yasunorim/mlb-statcast-bat-tracking-2024-2025
- Analysis Notebook: https://www.kaggle.com/code/yasunorim/mlb-bat-tracking-analysis-2024-2025
- GitHub Repository: https://github.com/yasumorishima/kaggle-datasets
- Data Generation Notebook: Google Colab
Discussion