Author: Noah Lippman: Data Science Major at Indiana University and Normal CornBelters Baseball Analytics Intern

0. What are wOBA and xWOBA?

wOBA is a widely used baseball statistic that attempts to evaluate the average runs created by a player per plate appearance. wOBA is a more carefully constructed and representative statistic than OPS, as each outcome is assigned a run value based on the average number of runs it creates. For my model, I used the 2025 MLB run values (BB = .692, HBP = .732, 1B = .885, 2B = 1.258, 3B = 1.593, HR = 2.053). These run values are calculated each season using linear weights. I won’t expand on the methodology, but it is well explained in this FanGraphs article: https://library.fangraphs.com/principles/linear-weights/. While wOBA is an extremely accurate measure of the results that a player has achieved, it is not always a correct measure of the results they deserved.

There is an element of baseball that is inherently luck-based, and wOBA can be heavily influenced by luck. In the first video below, Yordan Alvarez hits a ball 111 mph on a line to centerfield, but Leody Taveras robs it, and the wOBA value of the swing is 0. Conversely, in the second video, Fulford hits a 55 mph soft line drive down the first baseline, resulting in a triple and a wOBA value of 1.593. This is where xWOBA can be valuable. xWOBA gives each batted ball a run value based on the run value of similar batted balls in terms of exit velocity and launch angle. Alvarez’s lineout to centerfield will be given a very high xWOBA, as balls hit 111 mph at a 25-degree launch angle are almost always home runs. Each batter’s walks and hits by pitches are added to each batted ball’s xWOBACON value (xWOBA for balls in play) and then divided by the hitter’s total plate appearances to find their xWOBA.

1. Methodology

After reading a fantastic article by Sam Sharpe, I chose to use K-nearest neighbors’ regression (KNN) to model xWOBA with Exit Velo and Launch angle as the predictor variables.  KNN regression is a supervised machine learning model that assigns a value to each point based on the nearest K points. K is the main parameter used when training a KNN model and can range from 0 to one less than the length of the data. A smaller value of K can lead to overfitting, as the model will only average a specific number of nearest points. Too large a value can lead to underfitting of the model. An underfit xWOBA model may factor in the value of a ball hit with a 30-degree launch angle and 100 mph exit velocity when determining the xWOBA value of a ball hit with a 30-degree launch angle and a 60 mph exit velocity. I used K-Fold cross-validation to choose the optimal value of K for my model. K-Fold cross-validation splits the data into K folds or parts (I chose 5) and then uses 4 of the folds to train the model and 1 of the folds to test the model. This process is repeated until all folds are used to test the model. The RMSE of each iteration is then averaged, and a final score is produced. By viewing where the RMSE begins to level out, we can choose our optimal K value (11).

2. Evaluation

After choosing 21 as our K value, we train our final model on all the data and assign an xWOBA value for combinations of all launch angles from -75 to 75 degrees and all exit velocities from 0 to 110 mph (a range that includes all balls put into play in the KCL. The following two graphs show the predicted xWOBACON (xWOBA on balls in play) and the xWOBACON values of all balls in play during the 2025 KCL season.

As you can see, the xWOBACON model does a good job of distinguishing that balls with exit velocities greater than 90 and launch angles between 20 and 35 are the most likely to result in extra base hits. The model also does a good job of identifying that soft line drives have a good chance of being base hits, as they often land in front of outfielders.

3. Results

Top 10 KCL Hitters by xWOBA (minimum 27 PA)

Top 10 Unluckiest Hitters (minimum 27 PA)

4. Limitations

While my xWOBA model does a good job accounting for how exit velocity and launch angle affect the average run value of a batted ball, the model does not account for a player’s sprint speed due to a lack of data. The model used by MLB factors in a player’s sprint speed on ground balls. A very fast player will have a higher xWOBACON on slow ground balls than a very slow player because they are more likely to beat it out for an infield single. Unfortunately, Yakkertech does not capture a player’s sprint speed, so fast groundball hitters will likely be underestimated by the model, while slow groundball hitters will likely be overestimated. There were also many batted balls this season that Yakkertech did not produce exit velo and launch angle readings for. These batted balls could not be given an xWOBA, so I decided to assign the average xWOBA of plays of the same outcome. This is not a perfect methodology, but I believe that it is the fairest way to resolve missing data.

5. Conclusion

xWOBA is an especially valuable metric for the KCL, as the 25-game sample size means that each batted ball has a large effect on a player’s WOBA. A few hard-hit balls that result in outs can greatly decrease a player’s WOBA; however, their xWOBA will likely increase as hard-hit balls are given high xWOBA values. This data can be used to identify players who hit the ball hard and with good launch angles but got unlucky.

This project strengthened my skills in statistical modeling and data visualization in Python. I want to thank the CornBelters for the opportunity to work with in-depth data in a baseball setting.

6. Sources

  • Sharpe, Sam. “An Introduction to Expected Weighted On-Base Average (xwOBA).” Medium, MLB Technology Blog, 24 Sept. 2019, technology.mlblogs.com/an-introduction-to-expected-weighted-on-base-average-xwoba-29d6070ba52b.
  • Slowinski, Piper. “Linear Weights.” Sabermetrics Library, library.fangraphs.com/principles/linear-weights/. Accessed 25 July 2025.

Code

https://github.com/NoahLippman/Kernelytics-Projects/tree/main/xWOBA_KCL

Leave a Comment