Skip to content

docs: add explain forecast snippet to multiple time series tutorial #1586

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 3, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -161,3 +161,15 @@ def test_multiple_timeseries_forecasting_model(random_model_id: str) -> None:
# 20 2016-10-02 00:00:00+00:00 Central Park West & W 72 St 175.474862 40.940794 0.9 ...
# 12 2016-10-01 00:00:00+00:00 W 106 St & Central Park West 63.88163 18.088868 0.9 ...
# [END bigquery_dataframes_bqml_arima_multiple_step_6_forecast]
# [START bigquery_dataframes_bqml_arima_multiple_step_7_explain]
explain = model.predict_explain(horizon=3, confidence_level=0.9)

print(explain.peek(5))
# Expected output:
# time_series_timestamp start_station_name time_series_type time_series_data time_series_adjusted_data standard_error confidence_level prediction_interval_lower_bound prediction_interval_upper_bound trend seasonal_period_yearly seasonal_period_quarterly seasonal_period_monthly seasonal_period_weekly seasonal_period_daily holiday_effect spikes_and_dips step_changes residual
# 0 2013-07-01 00:00:00+00:00 Central Park S & 6 Ave history 69.0 154.168527 32.572948 <NA> <NA> <NA> 0.0 35.477484 <NA> <NA> -28.402102 <NA> <NA> 0.0 -85.168527 147.093145
# 1 2013-07-01 00:00:00+00:00 Grand Army Plaza & Central Park S history 79.0 79.0 24.982769 <NA> <NA> <NA> 0.0 43.46428 <NA> <NA> -30.01599 <NA> <NA> 0.0 0.0 65.55171
# 2 2013-07-02 00:00:00+00:00 Central Park S & 6 Ave history 180.0 204.045651 32.572948 <NA> <NA> <NA> 147.093045 72.498327 <NA> <NA> -15.545721 <NA> <NA> 0.0 -85.168527 61.122876
# 3 2013-07-02 00:00:00+00:00 Grand Army Plaza & Central Park S history 129.0 99.556269 24.982769 <NA> <NA> <NA> 65.551665 45.836432 <NA> <NA> -11.831828 <NA> <NA> 0.0 0.0 29.443731
# 4 2013-07-03 00:00:00+00:00 Central Park S & 6 Ave history 115.0 205.968236 32.572948 <NA> <NA> <NA> 191.32754 59.220766 <NA> <NA> -44.580071 <NA> <NA> 0.0 -85.168527 -5.799709
# [END bigquery_dataframes_bqml_arima_multiple_step_7_explain]