Revert to a snapshot Added in 5.4.0
The machine learning features react quickly to anomalous input, learning new behaviors in data. Highly anomalous input increases the variance in the models whilst the system learns whether this is a new step-change in behavior or a one-off event. In the case where this anomalous input is known to be a one-off, then it might be appropriate to reset the model state to a time before this event. For example, you might consider reverting to a saved snapshot after Black Friday or a critical system failure.
Path parameters
-
Identifier for the anomaly detection job.
-
You can specify
empty
as the. Reverting to the empty snapshot means the anomaly detection job starts learning a new model from scratch when it is started.
Query parameters
-
delete_intervening_results boolean
If true, deletes the results in the time period between the latest results and the time of the reverted snapshot. It also resets the model to accept records for this time period. If you choose not to delete intervening results when reverting a snapshot, the job will not accept input data that is older than the current time. If you want to resend data, then delete the intervening results.
Body
-
delete_intervening_results boolean
Refer to the description for the
delete_intervening_results
query parameter.
curl \
-X POST http://api.example.com/_ml/anomaly_detectors/{job_id}/model_snapshots/{snapshot_id}/_revert \
-H "Content-Type: application/json" \
-d '{"delete_intervening_results":true}'
{
"delete_intervening_results": true
}
{
"model": {
"description": "string",
"job_id": "string",
"latest_record_time_stamp": 42.0,
"latest_result_time_stamp": 42.0,
"min_version": "string",
"model_size_stats": {
"bucket_allocation_failures_count": 42.0,
"job_id": "string",
"": 42.0,
"memory_status": "ok",
"assignment_memory_basis": "string",
"result_type": "string",
"total_by_field_count": 42.0,
"total_over_field_count": 42.0,
"total_partition_field_count": 42.0,
"categorization_status": "ok",
"categorized_doc_count": 42.0,
"dead_category_count": 42.0,
"failed_category_count": 42.0,
"frequent_category_count": 42.0,
"rare_category_count": 42.0,
"total_category_count": 42.0,
"timestamp": 42.0
},
"retain": true,
"snapshot_doc_count": 42.0,
"snapshot_id": "string",
"timestamp": 42.0
}
}