Giter Site home page Giter Site logo

jacobjc2 / pitching-analysis Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 1.88 MB

Pitching analysis project using machine learning and other data science techniques to gain insight on the effectiveness of pitching in the MLB.

HTML 66.48% Jupyter Notebook 33.52%

pitching-analysis's Introduction

Analysis of Pitch Quality using MLB PITCHf/x Data

By: Jacob Christensen

Pitching a baseball is considered by many to be an art form. There are countless different ways to structure a stance, delivery, and release and all of that takes place before the ball even leaves the pitcher's hand. Once the ball is in the air, things like speed, spin rate, and trajectory will affect the path of the ball as it travels towards home plate. Each of these different factors play their own part in determining the "quality" of the pitch. In this analysis, the expected number of bases gained by the batter will be used as the metric for pitch quality. Hundreds of thousands of pitches are thrown every year by professional pitchers in the MLB. In order to accurately track each of these pitches and provide feedback to umpires making calls on each of them, the MLB employs a system called "PITCHf/x". This system was created by a company called Sportvision that worked in tandem with the MLB to get it installed in every professional baseball stadium in the country. "PITCHf/x" typically utilizes three cameras mounted in each stadium to track what kind of pitch was thrown, the path of the ball during its flight, the speed of the pitch, and many other statistics. The system also reports the outcome of the pitch (i.e. ball, strike, out, single, etc.). This project aims to analyze the different aspects of pitches thrown by multiple pitchers to determine what has the greatest affect on the "quality" of the pitch. The variables that are being targeted for this analysis are:

pitch type, velocity, spin rate, zone, pitcher handedness, batter handedness, pitch count, pitch number, number of outs, release point

Some questions that this information will attempt to answer are:

Does the handedness of a pitcher have a significant impact on average pitch quality?
What part of the delivery should a pitcher focus on the most to increase pitch quality?
Are there any major features that indicate a lower average pitch quality?

The data for this analysis was retrieved from https://baseballsavant.mlb.com/, a website run by the MLB that provides public access to the data collected from the PITCHf/x system. This project also referenced a Stanford graduate school paper on calculating pitch quality and an article from the MLB about the differences between spin rate and velocity in pitches. Using these resources, the data from 8 different pitchers was read into a dataframe and analyzed using exploratory data analysis techniques. The exploratory data analysis process involved examining the relationships between the features (listed above) of the pitch and the outcome. Once a basic understanding of these relationships had been established, multiple linear regression models were set up and trained in a attempt to predict the outcome of the pitches.

The analysis of the PITCHf/x data revealed much about the relationship between many of the features that describe the pitch that was thrown and the situation it was thrown in. Exploring each of the relevant features showed that the variables with the strongest correlation to bases yielded were the pitch count (balls and strikes) and the matchup between pitcher and batter handedness. Another factor, related to pitch count, that seemed to be correlated to bases yielded was how many pitches were thrown in an at-bat. These correlations point to the conclusion that the situation the pitch is thrown in has the biggest effect on the outcome of the pitch. As far as the variables that describe the actual pitch, the pitch type, zone, and release position are the three factors that seem to be the most predictive of outcome of the pitch. All of these features have proven to be strong predictors when making predictions between 0 and 1 bases yielded, but none of the models were able to predict when the batter was going to hit the ball or gain more than 1 base. Further analysis into the fielding and batting information may give more insight into when the ball will be hit.

pitching-analysis's People

Watchers

Jacob Christensen avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.