Skip to content

A pet project pitch classifier built during my time working for the UCSD baseball team

Notifications You must be signed in to change notification settings

joshsalce/Real-Time_Pitch_Classifier

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 

Repository files navigation

UCSD Baseball 2023 Pitch Classifier

Description

This is a locally run web-application that can classify pitches in real-time based on which pitcher is in a game. Using the socket.io package in JavaScript, a pitcher can be selected from a dropdown-menu. After pressing "Start," an sklearn model is built on the pitcher's Yakkertech pitch data, and a Python connection to the Yakkertech cameras is established using the socketIO-client package. Incoming pitch data is then continuously parsed and predicted on. Each prediction is written from a Python localhost client to the front-end HTML page in the style of an MLB stadium showing pitch data. "Pausing" the application will terminate the socket.io server but keep the Python client running. A working demo of this application can be found here.

Motivation

The spark for this project came during my first days interning with the UCSD Baseball Team. While tagging scrimmages initally, I found myself making some errors based on unfamiliarity with each pitcher's unique pitch characteristics (i.e. differences in spin rates for fastballs and sinkers, vertical and horizontal break for LHP curveballs and sliders). At the same time, I had been introduced to the Python package sklearn in my academics. This project aims to increase my familiarity with sklearn and build a tool that can correct for initial tagging errors.

Packages and Tech Used

Table of Contents

Component Description
File Schematic Layout of file organization and relationships
Code Code section including all coding files except for datasets, node, .env, and Python server files
Miscellaneous Miscellaneous section including diagrams documenting thought process of project, proof of concepts, and test scripts

Directions

  1. Install all necessary packages via terminal commands.
  2. cd to directory of classifier project, and initialize a split terminal, running the following functions separately in VSCode:
npm start
python3 Client/client.py
  1. Load in application via url http://127.0.0.1:3000/
  2. Select a pitcher via the dropdown menu, and press 'Start' button
  3. To pause classification, click the 'Pause' button. The HTML page will stop writing incoming pitch data.
  4. To change to a new pitcher, reload the application and restart the Python client file from the terminal. To kill the Python client, press control+c and re-enter the client command in Step 2

Credits

Grateful for UCSD President of Baseball Operations Ryan Bobb for granting me access to UCSD pitch data and Yakkertech interface, as well as Jacob Clark of Yakkertech for staying in correspondence with me throughout the duration of this project. None of this would have happened without their help.

About

A pet project pitch classifier built during my time working for the UCSD baseball team

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published