mirror of
https://github.com/saymrwulf/prophet.git
synced 2026-09-15 22:10:22 +00:00
added argument for point color to cv plot (#1895)
This commit is contained in:
parent
7ace29d70b
commit
4b859bca01
1 changed files with 3 additions and 2 deletions
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue