Skip to content

docs: add the first sample for the Single time-series forecasting from Google Analytics data tutorial #623

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 17 commits into from
Apr 23, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
fix: forecast method to forecast time series
  • Loading branch information
SalemJorden committed Feb 20, 2024
commit adc22ef8a872227ee49ee0907b35eb8e5775bab9
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,30 @@ def test_create_single_timeseries(random_model_id):
)

# Inspect the evaluation metrics of all evaluated models.
# when ruuning this function use same model, dataset, model name (str)
# when running this function use same model, dataset, model name (str)
evaluation = ga_arima_model.summary(
f'''
SELECT *
FROM ML.ARIMA_EVALUATE(MODEL `{your_model_id}`)
'''
show_all_candidate_models = False,
)

print(evaluation)

# Inspect the coefficients of your model


f'''
SELECT *
FROM ML.ARIMA_COEFFICIENTS(MODEL `{your_model_id}`)
'''
evaluation.ML.ARIMA_COEFFICIENTS()

# Use your model to forecast the time series
#standardSQL
your_model_id.forecast()

# Explain and visualize the forecasting results
f'''
SELECT *
FROM ML.EXPLAIN_FORECAST(
MODEL `{your_model_id}`,
STRUCT(
[horizon AS horizon]
[, confidence_level AS confidence_level]))
'''