Update app.py
Browse files
app.py
CHANGED
@@ -92,7 +92,7 @@ def server(input, output, session):
|
|
92 |
fig.colorbar(h, ax=ax, label='xwOBA',format=tkr.FormatStrFormatter('%.3f'),shrink=0.5,
|
93 |
ticks=bounds)
|
94 |
|
95 |
-
if
|
96 |
h = ax.hexbin(df['launch_speed'],
|
97 |
df['launch_angle'],
|
98 |
C=df['xslg'],
|
@@ -130,7 +130,7 @@ def server(input, output, session):
|
|
130 |
texts = [ax.text(x_select+3, y_select+3, f'xwOBA: {xwoba_value:.3f}', color='black', fontsize=12, weight='bold',
|
131 |
zorder=1000, bbox=dict(facecolor='white', alpha=0.5, edgecolor='black'))]
|
132 |
|
133 |
-
else
|
134 |
xwoba_value = (xwoba_model.predict_proba([[y_select,x_select]]) @ [0, 1, 2, 3, 4])[0]
|
135 |
texts = [ax.text(x_select+3, y_select+3, f'xSLG: {xwoba_value:.3f}', color='black', fontsize=12, weight='bold',
|
136 |
zorder=1000, bbox=dict(facecolor='white', alpha=0.5, edgecolor='black'))]
|
|
|
92 |
fig.colorbar(h, ax=ax, label='xwOBA',format=tkr.FormatStrFormatter('%.3f'),shrink=0.5,
|
93 |
ticks=bounds)
|
94 |
|
95 |
+
if:
|
96 |
h = ax.hexbin(df['launch_speed'],
|
97 |
df['launch_angle'],
|
98 |
C=df['xslg'],
|
|
|
130 |
texts = [ax.text(x_select+3, y_select+3, f'xwOBA: {xwoba_value:.3f}', color='black', fontsize=12, weight='bold',
|
131 |
zorder=1000, bbox=dict(facecolor='white', alpha=0.5, edgecolor='black'))]
|
132 |
|
133 |
+
else:
|
134 |
xwoba_value = (xwoba_model.predict_proba([[y_select,x_select]]) @ [0, 1, 2, 3, 4])[0]
|
135 |
texts = [ax.text(x_select+3, y_select+3, f'xSLG: {xwoba_value:.3f}', color='black', fontsize=12, weight='bold',
|
136 |
zorder=1000, bbox=dict(facecolor='white', alpha=0.5, edgecolor='black'))]
|