Repository navigation
MLB Stat Classifier - A machine learning application for better understanding the MLB, developed by Vivek Jagadeesh
Note - This readme serves a "user manual" for this application. A detailed explanation of my experience developing the application (along with other projects), and the construction of the technology stack is available at vivekjagadeesh.com.Overview and Motivation
As a lifelong fan of the Boston Red Sox, I've frequently found myself asking "what pitch was that?" while watching the games. As I began to learn more about machine learning, I found that classifying MLB pitches would be a fun introduction to the field.
Features
This application contains the following features- A machine learning model for classifying MLB pitches (more on this later)
- A tool for comparing MLB pitchers on the basis of velocity, horizontal and vertical movement
- A tool for viewing historical pitch and player data from baseball savant
Getting Started - Classifying a pitch
The first feature of MLB Classifier is the ability to classify any pitch using the following features:
- The pitch velocity
- The movement in the Z direction
- The rise (vertical movement relative to its expected path)
- The movement in the x direction
- The tail (horizontal movement realtive to its expected path)
Note - A detailed description of how the dataset and features were selected is available on my portfolio website at vivekjagadeesh.com
To classify a pitch, simply enter the features into the form in the bottom left hand corner, and use the submit button to run the classifier. The clear button is used to remove any temporary entries in the form.
Using the player comparison tool
To compare two players, start by clicking the "New Comparison" button in the center. This will open a modal where you can select the players that you would like to compare via the two drop-down menus (these contain active players as of August 2024) . Once you have selected two players to compare, continue by clicking submit, and the statistics for each player will appear in the two panes on the screen.Viewing historical MLB data
Finally, the last feature of MLB Classifier is the ability to view historical data from Baseball Savant. To individual pitches (and their related statistics), use the slider at the top of the page to select pitches. To view pitchers, selected pitchers and the below table will appear. Finally, pagination controls are available at the bottom of the table
Appendix - Building and Running the project
To run this project, clone the repository and run npm run start in the root directory. This will start both the frontend (next.js) and backend (flask). Additionally, you will need to have a local postgresql server running and configure the connection string. To run just the frontend, run npm run dev in the frontend directory. To run just the backend, run flask run in the backend directory.
What's Changed
- Seed db by @vivekjag1 in #1
- add relationship between pitchers and pitches, other small improvements by @vivekjag1 in #2
- Dev by @vivekjag1 in #3
- Dev by @vivekjag1 in #4
- refactor ci/cd pipeline to only execute on commit to prod branch by @vivekjag1 in #5
- Dev by @vivekjag1 in #6
- Dev by @vivekjag1 in #7
- Dev by @vivekjag1 in #8
- rollback package by @vivekjag1 in #9
- Dev by @vivekjag1 in #10
- Dev by @vivekjag1 in #11
- Dev by @vivekjag1 in #12
- Dev by @vivekjag1 in #13
- Dev hero page by @vivekjag1 in #14
- Dev by @vivekjag1 in #15
- fix dependencies by @vivekjag1 in #16
- Dev by @vivekjag1 in #17
- Dev classifier page by @vivekjag1 in #18
- Dev by @vivekjag1 in #19
- add flask cors by @vivekjag1 in #20
- Dev by @vivekjag1 in #21
- Dev by @vivekjag1 in #22
- Dev classifier page by @vivekjag1 in #23
- Dev by @vivekjag1 in #24
- backend dockerfile fix by @vivekjag1 in #25
- Dev by @vivekjag1 in #26
- update workflow by @vivekjag1 in #27
- Dev by @vivekjag1 in #28
- Dev classifier page by @vivekjag1 in #29
- Dev by @vivekjag1 in #30
Full Changelog: https://github.com/vivekjag1/MLBStatClassifier/commits/v1.0.0




