added argument for point color to cv plot (#1895)

This commit is contained in:
Greg Rafferty 2021-05-10 16:04:34 -07:00 committed by GitHub
parent 7ace29d70b
commit 4b859bca01
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -473,7 +473,8 @@ def add_changepoints_to_plot(
def plot_cross_validation_metric( def plot_cross_validation_metric(
df_cv, metric, rolling_window=0.1, ax=None, figsize=(10, 6), color='b' df_cv, metric, rolling_window=0.1, ax=None, figsize=(10, 6), color='b',
point_color='gray'
): ):
"""Plot a performance metric vs. forecast horizon from cross validation. """Plot a performance metric vs. forecast horizon from cross validation.
@ -543,7 +544,7 @@ def plot_cross_validation_metric(
x_plt = df_none['horizon'].astype('timedelta64[ns]').astype(np.int64) / float(dt_conversions[i]) x_plt = df_none['horizon'].astype('timedelta64[ns]').astype(np.int64) / float(dt_conversions[i])
x_plt_h = df_h['horizon'].astype('timedelta64[ns]').astype(np.int64) / float(dt_conversions[i]) x_plt_h = df_h['horizon'].astype('timedelta64[ns]').astype(np.int64) / float(dt_conversions[i])
ax.plot(x_plt, df_none[metric], '.', alpha=0.1, c=color) ax.plot(x_plt, df_none[metric], '.', alpha=0.1, c=point_color)
ax.plot(x_plt_h, df_h[metric], '-', c=color) ax.plot(x_plt_h, df_h[metric], '-', c=color)
ax.grid(True) ax.grid(True)