wOBA modification pt. 3 (finale)

jerrymckennan
3 min readOct 19, 2021

--

I haven’t had a ton of time lately to really work on this and play around. But lately I’ve been able to and made some final changes, whether for the better or not.

So first up. Let me go back to my initial numbers:

Starting numbers for wOBA

Specifically I would like to discuss the outs. So the process is to zero out outs because, techincally, they should be worth nothing. But in this case, we see that outs are “more valuable” for hard hit balls vs softly hit balls. So with that in mind, I didn’t know why they shouldn’t be more valuable in general. So what would be an easy way to do this? Well… instead of using each hit type, I added so that all hits would be zeroed out and the other two would have their difference. The end results are this:

wOBA constants with outs zeroed out for all hits

In doing this, it has made the likes of hard hits more valuable along the way as well. When looking at players comparing my previous way to the new way, there wasn’t a ton of difference. But for some, they gained/lost a point or two.

But that’s not the only reason I wanted to post. I was able to get a query together and export the results to a CSV for the purpose of doing something I haven’t done much the last month or so — create a graph. For this graph I wanted something simple and include three sets of data:

  1. My new wOBA
  2. FanGraphs wOBA
  3. The difference of the two

The coding for this was incredibly simple: three sections set up in my subplots, set some titles, use my CSV file to get the data. Here are the results:

wOBA calculations and differences

I am not sure why, but I’m always surprised to see the number of players who benefit vs don’t. They likely should especially if they hit lots of hard hit singles and doubles. Those see the biggest differences.

In all, I think this might be the final update I do with regards to this subject for a while. I want to (when I have time) apply this same theory to a full 162 game season.. and then again across multiple seasons. I also think this would allow me to play around with WAR calculations some better too. My practice with both wOBA and the defensive metrics has given me a decent framework to play with.

In the meantime, here’s my ridiculously simple code!

import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import numpy as np
data = pd.read_csv('/file/location.csv')x_labels = ('0.250','0.250','0.300','0.350','0.400','0.450','0.500')
x_labels2 = ('-0.040','-0.040','-0.020','0.000','0.020','0.040')
fig, axes = plt.subplots(1,3,sharey=True,figsize=((30,30)))
sns.stripplot(ax=axes[0], data=data, x='wOBA', y='full_name', color="blue").set_title('FanGraphs wOBA')
sns.stripplot(ax=axes[1], data=data, x='hhwOBA', y='full_name', color="red").set_title('New hard hit wOBA')
sns.barplot(ax=axes[2], data=data, x='Diff', y='full_name', palette=colors, alpha=0.25).set_title('Hard hit wOBA - FanGraphs wOBA')
axes[0].set_xticks((.25,.52),minor=True);
axes[0].set_xticklabels(labels=x_labels);
axes[0].set_ylabel("Player name");
axes[0].set_xlabel("wOBA");
axes[1].set_xticks((.25,.52),minor=True);
axes[1].set_xticklabels(labels=x_labels);
axes[1].set_ylabel(" ");
axes[1].set_xlabel("hard hit wOBA");
axes[2].set_xticks((-.055,.055),minor=True);
axes[2].set_xticklabels(labels=x_labels2);
axes[2].set_ylabel(" ");
axes[2].set_xlabel("Difference");
plt.savefig('/file/location.jpg')

plt.show()

Thanks for reading!

--

--

jerrymckennan
jerrymckennan

Written by jerrymckennan

Learning and writing about the journey

No responses yet