Predict future behavior of a time series
- POST /_ml/anomaly_detectors/{job_id}/_forecast
Forecasts are not supported for jobs that perform population analysis; an
error occurs if you try to create a forecast for a job that has an
over_field_name in its configuration. Forcasts predict future behavior
based on historical data.
- Cluster privileges:
manage_ml
Path Parameters
-
job_idstring Idrequired -
Identifier for the anomaly detection job. The job must be open when you create a forecast; otherwise, an error occurs.
Query Parameters
-
durationstring Duration · default: 1d A period of time that indicates how far into the future to forecast. For example,
30dcorresponds to 30 days. The forecast starts at the last record that was processed.-
expires_instring Duration · default: 14d The period of time that forecast results are retained. After a forecast expires, the results are deleted. If set to a value of 0, the forecast is never automatically deleted.
-
max_model_memorystring · default: 20mb The maximum memory the forecast can use. If the forecast needs to use more than the provided amount, it will spool to disk. Default is 20mb, maximum is 500mb and minimum is 1mb. If set to 40% or more of the job’s configured memory limit, it is automatically reduced to below that amount.
Request
-
durationstring Duration · default: 1d -
Refer to the description for the
durationquery parameter. -
expires_instring Duration · default: 14d -
Refer to the description for the
expires_inquery parameter. -
max_model_memorystring · default: 20mb -
Refer to the description for the
max_model_memoryquery parameter.
Response
-
acknowledgedbooleanrequired -
forecast_idstring Idrequired