<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Travis Petersen on Medium]]></title>
        <description><![CDATA[Stories by Travis Petersen on Medium]]></description>
        <link>https://medium.com/@travis.petersen?source=rss-4d96b8ea446a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*d9k9HAY0zqO0YDI3xP6nhg.png</url>
            <title>Stories by Travis Petersen on Medium</title>
            <link>https://medium.com/@travis.petersen?source=rss-4d96b8ea446a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 17 Nov 2026 01:32:13 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@travis.petersen/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[Augmenting Statcast Expected Batting Average with Sprint Speed]]></title>
            <link>https://technology.mlblogs.com/augmenting-statcast-expected-batting-average-with-sprint-speed-6be7f60770d2?source=rss-4d96b8ea446a------2</link>
            <guid isPermaLink="false">https://medium.com/p/6be7f60770d2</guid>
            <category><![CDATA[sabermetrics]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[statcast]]></category>
            <category><![CDATA[baseball]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Travis Petersen]]></dc:creator>
            <pubDate>Sat, 21 Sep 2019 01:27:03 GMT</pubDate>
            <atom:updated>2019-09-24T00:09:18.720Z</atom:updated>
            <content:encoded><![CDATA[<h3>Augmenting Expected Batting Average (xBA) with Sprint Speed</h3><blockquote>The Baseball Data Machine Learning team is focused on using data to tell the story of baseball and help serve baseball fans and clubs. Our team is constantly learning from the broader data science, machine learning, and sabermetric communities and will share our own experiences through this blog.</blockquote><p>The Baseball Data Machine Learning team develops models that unlock valuable insights for baseball fans across all platforms. One such model is expected batting average (xBA), which indicates the quality of contact made by the hitter, rather than relying on the luck-prone outcomes that drive batting average (BA) and can fluctuate in small samples. In 2018, we introduced the <a href="https://en.wikipedia.org/wiki/K-nearest_neighbors_algorithm">k-Nearest Neighbors</a> version of the <a href="http://m.mlb.com/glossary/statcast/expected-batting-average">expected batting average (xBA)</a> model which relied upon exit velocity and launch angle. We will refer to this as our “basic” k-NN model. Of course, players have control over other aspects of an at-bat to improve their probability of a hit other than just the exit velocity and launch angle.</p><p>As <a href="https://www.mlb.com/news/miguel-cabrera-deserved-better-in-2017-c262651084">analysts have demonstrated</a>, players who underperformed their xBA tend to be slower sluggers like Albert Pujols and Yonder Alonso, whereas players who outperformed their xBA tend to be faster players like Dee Gordon and César Hernández. In 2018 Dee Gordon had an xBA of .249 and an actual batting average of .268. Albert Pujols, on the other hand, had an xBA of .280 and an actual batting average of .245. In 2018 César Hernández had an xBA of .231 and an actual batting average of .253. Yonder Alonso had an xBA of .265 with an actual batting average of .250. This led us to investigate incorporating <a href="http://m.mlb.com/glossary/statcast/sprint-speed">sprint speed</a> into the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eYkssEEu3djYJygl.png" /></figure><p>Before we implement a model incorporating sprint speed, we need to identify where speed might help batters improve their outcomes. Sprint speed won’t help a ball fall for a hit in the outfield, so we focused on weak and topped balls from 2015 to 2018 where we found a strong relationship between batting average and sprint speed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*rsKQvx4Jb5Y34TxH.png" /></figure><p>To do this we use balls hit on the ground and weakly hit <a href="http://tangotiger.com/index.php/site/comments/statcast-lab-radial-woba-by-launch-anglespeed">balls with low exit velocities</a>. There are some easy infield pop-ups included in weakly hit balls, so we capped the launch angle at 60 degrees. We also want to ignore speed/angle combinations that lead to balls that are likely to land in the short outfield. To do this, we used <a href="http://baseball.physics.illinois.edu/trajectory-calculator-new3D.html">Alan Nathan’s distance calculator</a> to estimate expected distance on all speed and angle combinations and then capped the maximum expected distance at 120 feet.</p><p>Next, we evaluate different modeling methodologies. To start, we evaluate the performance of k-Nearest Neighbors (k-NN) by simply adding sprint speed to our basic model as a third variable. We also try fitting one model with speed, angle, and exit velocity scaled (using <a href="https://en.wikipedia.org/wiki/Feature_scaling#Rescaling_(min-max_normalization)">min-max normalization</a>) and one without scaling the variables. Because k-NN uses <a href="https://en.wikipedia.org/wiki/Euclidean_distance">Euclidean distance</a>, the algorithm is sensitive to the scale of the variables.</p><p>After fitting the models using <a href="https://en.wikipedia.org/wiki/Hyperparameter_optimization">grid search and cross-validation</a> to optimize the number of nearest-neighbors, we can evaluate the performance of predicting in-sample and out-of-sample data. The first table evaluates the two k-NN models compared to the basic model on batted balls. To evaluate performance we calculate the accuracy of the model’s xBA estimate with the actual outcome both in-sample (current year) and out-of-sample (next year).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/0*gFTQXBS-wQZtm0tb.png" /></figure><p>As we can see, both k-NN models represent modest improvements predicting both in-sample and out-of-sample.</p><p>After adding another dimension of player skill to model, we need to make sure that these changes produce intuitive and interpretable results, not just increase performance.</p><p>By grouping batting average by sprint speed, we see that the scaled variable model more closely approximates the effect that sprint speed has on the likelihood of a hit on a ground ball.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/618/0*RKeYBhpR7PsJ7pe6.png" /></figure><p>Next, we’d like to ensure that the output from the model is intuitive and unfortunately that is where the sprint speed k-NN model struggles.</p><p>A good example is a Trea Turner infield single from 7/31/2018.</p><p>The xBA for a 90 mph exit velocity, -17 degrees launch angle batted ball for a 30 feet per second (fps) runner like Turner is estimated at .590 using the scaled k-NN model; however, the xBA for the same launch angle and exit velocity combination for a 27 fps runner is .980. There isn’t a good reason why a slower player might have a better chance at a hit than a faster player. It is likely that the new k-NN model is <a href="https://en.wikipedia.org/wiki/Overfitting">fitting to noise</a>. While there are steps we can take to reduce overfitting we’d like to constrain speed’s effect to increase monotonically.</p><p>To force some constraints, we evaluated using a Generalized Additive Model (<a href="https://en.wikipedia.org/wiki/Generalized_additive_model">GAM</a>). GAMs allow us to capture the non-linear patterns in our dataset without using polynomials or binning and we can control the smoothing parameter to avoid overfitting. In our case it allows us to capture the relationship of sprint speed while also incorporating the non-linear relationship of the angle and exit velocity.</p><p>To train our model, we used the <a href="https://pygam.readthedocs.io/en/latest/?badge=latest">pyGAM</a> package and we fit using a linear term on sprint speed and a tensor product term on exit velocity and launch angle.</p><p>Looking at the results we see that while the GAM model doesn’t improve at the batted ball level, we see reliability and predictive improvements when we evaluate model performance at the player level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/0*PCco4SuDE7fbYC9p.png" /></figure><p>Using weighted <a href="https://en.wikipedia.org/wiki/Pearson_correlation_coefficient">Pearson correlations</a> for season-long player batting average on ground ball results, we can determine how well each model captures the ability of a player. To do that we will use a similar framework that Jonathan Judge laid out at Baseball Prospectus by <a href="https://www.baseballprospectus.com/news/article/31324/prospectus-feature-dra-2017-the-convergence/">testing the descriptive, reliability, and predictive correlations</a>. To measure the descriptive correlation we compare the same-year xBA with the same-year batting average. To measure reliability, we compare the same-year xBA with the next-year xBA. To measure the predictive correlation, we compare the same-year xBA and the next-year batting average. We limited the analyses to batted balls with a maximum expected distance at 120 feet.</p><p>Below we see that the GAM linear constraint improves the year to year reliability of batting average on ground balls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/0*2iVNj2CeUaOHaSud.png" /></figure><p>While the reliability boost is great, we would like an interpretable model without sacrificing accuracy at the batted ball level.</p><p>To do that we can use a Logistic GAM using a linear term for the sprint speed of the player and a <a href="https://en.wikipedia.org/wiki/Spline_(mathematics)">spline term</a> on the output of the speed and angle k-NN model.</p><p>Looking at the results, we see that we were able to improve the descriptive and predictive power at the batted ball level while maintaining a similar predictive correlation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/424/0*a0fNbvCLw1YsEUHj.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/466/0*aAb9n634_flkhloK.png" /></figure><p>With the linearly-adjusted k-NN, we can take a look at what updated xBA figures are for Albert Pujols, Dee Gordon, Yonder Alonso, and César Hernández. With the speed-augmented model Pujols (-.015) and Alonso (-.013) have their xBA’s lowered, while Dee Gordon (.026) and César Hernández (.021) have their xBA’s raised.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*80_Um2I2w4V5lK5l.png" /></figure><p>We see similar findings when we evaluate the wOBA version of the model. The speed-augmented model performs well at both the batted ball and player level.</p><p>You can see a full breakdown of player level changes in 2018 <a href="https://docs.google.com/spreadsheets/d/15AG8NrQ98Klx6ZkAw5oc006csHf5JzIVWaUsCVp3mTQ/edit?usp=sharing">here</a>.</p><p>For an in-depth look at the strengths and limitations of xwOBA please read <a href="https://technology.mlblogs.com/an-introduction-to-expected-weighted-on-base-average-xwoba-56e3fa6093cd">“An Introduction to Expected Weighted On-Base Average”</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6be7f60770d2" width="1" height="1" alt=""><hr><p><a href="https://technology.mlblogs.com/augmenting-statcast-expected-batting-average-with-sprint-speed-6be7f60770d2">Augmenting Statcast Expected Batting Average with Sprint Speed</a> was originally published in <a href="https://technology.mlblogs.com">MLB Technology Blog</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>