Inspiration

Baseball is a game filled with data-driven insights, and analyzing home run plays can offer valuable information about player performance. The idea for this project came from the desire to combine machine learning with video processing to create an engaging way to visualize baseball statistics.

What it does

  • Fetches baseball home run data and player statistics
  • Processes the data to extract key metrics
  • Predicts the probability of a hit being a home run using machine learning
  • Overlays statistical information onto highlight videos
  • Provides an engaging visualization of baseball plays

How we built it

  1. Data Collection: Pulled home run statistics from Google Cloud Storage and player details from the MLB API.
  2. Data Processing: Cleaned and extracted key features such as Exit Velocity, Launch Angle, and Hit Distance.
  3. Machine Learning Model: Trained a Random Forest Classifier to predict whether a hit would be a home run.
  4. Video Processing: Used OpenCV to overlay statistics on highlight videos.
  5. Visualization: Used Matplotlib and Seaborn to display data insights.

Challenges we ran into

  • Data Quality Issues: Handling missing or inconsistent values.
  • Model Accuracy: Tuning the model to improve predictions.
  • Video Overlay Synchronization: Aligning data points with the correct frames.
  • API Rate Limits: Efficiently managing API requests.

Accomplishments that we're proud of

  • Integrating machine learning predictions with real-time video overlays.
  • Achieving a strong ROC AUC score for home run predictions.
  • Creating interactive visualizations for baseball analytics.
  • Overcoming technical challenges in video processing.

What we learned

  • Working with sports analytics data.
  • Fine-tuning machine learning models.
  • Using OpenCV for real-time overlays.
  • Managing large datasets efficiently.
  • The importance of feature selection in predictions.

What's next for S2A2R_Variables!

  • Expanding analysis to strikeouts, stolen bases, and defensive plays.
  • Enhancing video overlays with real-time annotations.
  • Creating a live dashboard for in-game probabilities.
  • Exploring deep learning models for accuracy.
  • Collaborating with baseball analysts to refine insights.

We’re excited about the future of S2A2R_Variables and look forward to pushing the boundaries of sports analytics! ⚾🚀

Built With

Share this project:

Updates