I am using ARIMA plus model to predict anomalies. My TIME_SERIES_DATA_COL parameter is number of incidents received per day and is integer value in input. But the ARIMA plus model in output converts this to fraction value in some rows which is incorrect as number of incident received cannot be fractional. How to correct this behavior. My Query is as follows:
CREATE OR REPLACE MODEL `test_inputs_arima.ARIMA_15mins_model`
OPTIONS
(MODEL_TYPE = 'ARIMA_PLUS',
TIME_SERIES_TIMESTAMP_COL = 'opened_at',
TIME_SERIES_DATA_COL = 'number',
TIME_SERIES_ID_COL = 'Issue_Category',
HOLIDAY_REGION = ['GLOBAL'])
AS
SELECT
opened_at,
number,
Issue_Category
FROM
test_inputs_arima.15_mins_7days;
CREATE OR REPLACE TABLE test_inputs_arima.ARIMA_15mins_out
AS
(SELECT
Issue_Category,opened_at,number,is_anomaly,lower_bound,upper_bound,anomaly_probability
FROM
ML.DETECT_ANOMALIES(
MODEL `test_inputs_arima.ARIMA_15mins_model`,
STRUCT(0.9 AS anomaly_prob_threshold)
));
Update test_inputs_arima.ARIMA_15mins_out
set is_anomaly = false
where number<lower_bound;
SELECT * FROM test_inputs_arima.ARIMA_15mins_out;
User | Count |
---|---|
2 | |
1 | |
1 | |
1 | |
1 |