Skip to content

Commit 40c55a0

Browse files
authored
docs: add explain forecast snippet to multiple time series tutorial (#1586)
1 parent 570cff3 commit 40c55a0

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

samples/snippets/create_multiple_timeseries_forecasting_model_test.py

+12
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,15 @@ def test_multiple_timeseries_forecasting_model(random_model_id: str) -> None:
161161
# 20 2016-10-02 00:00:00+00:00 Central Park West & W 72 St 175.474862 40.940794 0.9 ...
162162
# 12 2016-10-01 00:00:00+00:00 W 106 St & Central Park West 63.88163 18.088868 0.9 ...
163163
# [END bigquery_dataframes_bqml_arima_multiple_step_6_forecast]
164+
# [START bigquery_dataframes_bqml_arima_multiple_step_7_explain]
165+
explain = model.predict_explain(horizon=3, confidence_level=0.9)
166+
167+
print(explain.peek(5))
168+
# Expected output:
169+
# 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
170+
# 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
171+
# 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
172+
# 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
173+
# 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
174+
# 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
175+
# [END bigquery_dataframes_bqml_arima_multiple_step_7_explain]

0 commit comments

Comments
 (0)