Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SELECT
year,
month,
day,
cumsum,
ROUND(predicted_label) predicted,
monthly_cost actual_month_cost,
ROUND(100 * (ABS(predicted_label - monthly_cost) / monthly_cost),1) abs_err
FROM
ML.PREDICT(MODEL `billing_dataset_example.model_linear_regression`,
(
SELECT
Year, month, day, cumsum, mean_daily_cost,
ROUND(monthly_cost) monthly_cost
FROM
`billing_dataset_example.linear_regression_dataset`
WHERE
account_name = 'DoIT'
AND YEAR >= 2017))
ORDER BY
year,
month,
day
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment