Skip to content

Commit

Permalink
[fix] Pytests Plots (#1445)
Browse files Browse the repository at this point in the history
* adjusted conformal prediction plot

* removed unused line

---------

Co-authored-by: Oskar Triebe <ourownstory@users.noreply.github.com>
  • Loading branch information
SimonWittner and ourownstory authored Oct 17, 2023
1 parent 583e15b commit a22a579
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -665,9 +665,7 @@ def test_plot_conformal_prediction(plotting_backend):
alpha = 0.1
for method in ["naive", "cqr"]: # Naive and CQR SCP methods
future = m.make_future_dataframe(test_df, periods=m.n_forecasts, n_historic_predictions=10)
forecast = m.conformal_predict(
future, calibration_df=cal_df, alpha=alpha, method=method, plotting_backend=plotting_backend
)
forecast = m.conformal_predict(future, calibration_df=cal_df, alpha=alpha, method=method)
m.highlight_nth_step_ahead_of_each_forecast(m.n_forecasts)
fig0 = m.plot(forecast, plotting_backend=plotting_backend)
fig1 = m.plot_components(forecast, plotting_backend=plotting_backend)
Expand All @@ -691,9 +689,7 @@ def test_plot_conformal_prediction(plotting_backend):
alpha = 0.1
for method in ["naive", "cqr"]: # Naive and CQR SCP methods
future = m.make_future_dataframe(df, periods=m.n_forecasts, n_historic_predictions=10)
forecast = m.conformal_predict(
future, calibration_df=cal_df, alpha=alpha, method=method, plotting_backend=plotting_backend
)
forecast = m.conformal_predict(future, calibration_df=cal_df, alpha=alpha, method=method)
m.highlight_nth_step_ahead_of_each_forecast(m.n_forecasts)
fig0 = m.plot(forecast)
fig1 = m.plot_latest_forecast(forecast, include_previous_forecasts=10, plotting_backend=plotting_backend)
Expand Down Expand Up @@ -728,15 +724,13 @@ def test_advanced_conformal_prediction_plots():
train_df, cal_df = m.split_df(train_df, freq="D", valid_p=0.15)
m.fit(train_df, freq="D")
alpha = 0.1
plotting_backend = "plotly"
for method in ["naive", "cqr"]: # Naive and CQR SCP methods
future = m.make_future_dataframe(test_df, periods=m.n_forecasts, n_historic_predictions=10)
forecast = m.conformal_predict(
future,
calibration_df=cal_df,
alpha=alpha,
method=method,
plotting_backend=plotting_backend,
show_all_PI=True,
)
fig0 = m.conformal_plot(forecast)
Expand All @@ -762,9 +756,7 @@ def test_plot_conformal_prediction_asymmetric(plotting_backend):
alpha = (0.03, 0.07)
method = "cqr"
future = m.make_future_dataframe(test_df, periods=m.n_forecasts, n_historic_predictions=10)
forecast = m.conformal_predict(
future, calibration_df=cal_df, alpha=alpha, method=method, plotting_backend=plotting_backend
)
forecast = m.conformal_predict(future, calibration_df=cal_df, alpha=alpha, method=method)
m.highlight_nth_step_ahead_of_each_forecast(m.n_forecasts)
fig0 = m.plot(forecast, plotting_backend=plotting_backend)
fig1 = m.plot_components(forecast, plotting_backend=plotting_backend)
Expand Down

0 comments on commit a22a579

Please sign in to comment.