2017-06-19 21:23:58 -04:00
|
|
|
[role="xpack"]
|
2018-08-31 19:49:24 -04:00
|
|
|
[testenv="platinum"]
|
2017-04-04 18:26:39 -04:00
|
|
|
[[ml-revert-snapshot]]
|
2018-12-20 13:23:28 -05:00
|
|
|
=== Revert model snapshots API
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2018-12-20 13:23:28 -05:00
|
|
|
<titleabbrev>Revert model snapshots</titleabbrev>
|
2017-12-14 13:52:49 -05:00
|
|
|
++++
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-06-13 16:37:35 -04:00
|
|
|
Reverts to a specific snapshot.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-revert-snapshot-request]]
|
|
|
|
==== {api-request-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2018-12-07 15:34:11 -05:00
|
|
|
`POST _ml/anomaly_detectors/<job_id>/model_snapshots/<snapshot_id>/_revert`
|
2017-04-11 16:25:38 -04:00
|
|
|
|
2019-06-27 16:58:42 -04:00
|
|
|
[[ml-revert-snapshot-prereqs]]
|
|
|
|
==== {api-prereq-title}
|
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
* Before you revert to a saved snapshot, you must close the job.
|
2019-06-27 16:58:42 -04:00
|
|
|
* If the {es} {security-features} are enabled, you must have `manage_ml` or
|
|
|
|
`manage` cluster privileges to use this API. See
|
2019-10-07 18:23:19 -04:00
|
|
|
<<security-privileges>>.
|
2019-06-27 16:58:42 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-revert-snapshot-desc]]
|
|
|
|
==== {api-description-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-12-31 13:53:05 -05:00
|
|
|
The {ml-features} reacts quickly to anomalous input, learning new
|
2018-01-15 11:44:08 -05:00
|
|
|
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.
|
2017-04-11 16:25:38 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-revert-snapshot-path-parms]]
|
|
|
|
==== {api-path-parms-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`<job_id>`::
|
2019-12-27 16:30:26 -05:00
|
|
|
(Required, string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=job-id-anomaly-detection]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`<snapshot_id>`::
|
2019-12-27 16:30:26 -05:00
|
|
|
(Required, string)
|
|
|
|
include::{docdir}/ml/ml-shared.asciidoc[tag=snapshot-id]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-revert-snapshot-request-body]]
|
|
|
|
==== {api-request-body-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-07-12 11:26:31 -04:00
|
|
|
`delete_intervening_results`::
|
|
|
|
(Optional, 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
|
2017-05-08 09:53:04 -04:00
|
|
|
model to accept records for this time period. The default value is false.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-11 16:25:38 -04:00
|
|
|
NOTE: 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.
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-06-27 12:42:47 -04:00
|
|
|
[[ml-revert-snapshot-example]]
|
|
|
|
==== {api-examples-title}
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2019-09-06 11:31:13 -04:00
|
|
|
[source,console]
|
2017-04-04 18:26:39 -04:00
|
|
|
--------------------------------------------------
|
2019-12-31 13:53:05 -05:00
|
|
|
POST _ml/anomaly_detectors/high_sum_total_sales/model_snapshots/1575402237/_revert
|
2017-04-04 18:26:39 -04:00
|
|
|
{
|
2017-04-11 16:25:38 -04:00
|
|
|
"delete_intervening_results": true
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
--------------------------------------------------
|
2019-12-27 16:30:26 -05:00
|
|
|
// TEST[skip:Kibana sample data]
|
2017-04-04 18:26:39 -04:00
|
|
|
|
2017-04-11 16:25:38 -04:00
|
|
|
When the operation is complete, you receive the following results:
|
2017-04-21 11:23:27 -04:00
|
|
|
[source,js]
|
2017-04-04 18:26:39 -04:00
|
|
|
----
|
|
|
|
{
|
2019-12-31 13:53:05 -05:00
|
|
|
"model" : {
|
|
|
|
"job_id" : "high_sum_total_sales",
|
|
|
|
"min_version" : "6.4.0",
|
|
|
|
"timestamp" : 1575402237000,
|
|
|
|
"description" : "State persisted due to job close at 2019-12-03T19:43:57+0000",
|
|
|
|
"snapshot_id" : "1575402237",
|
|
|
|
"snapshot_doc_count" : 1,
|
|
|
|
"model_size_stats" : {
|
|
|
|
"job_id" : "high_sum_total_sales",
|
|
|
|
"result_type" : "model_size_stats",
|
|
|
|
"model_bytes" : 1638816,
|
2019-12-27 16:30:26 -05:00
|
|
|
"model_bytes_exceeded" : 0,
|
|
|
|
"model_bytes_memory_limit" : 10485760,
|
|
|
|
"total_by_field_count" : 3,
|
2019-12-31 13:53:05 -05:00
|
|
|
"total_over_field_count" : 3320,
|
2019-12-27 16:30:26 -05:00
|
|
|
"total_partition_field_count" : 2,
|
|
|
|
"bucket_allocation_failures_count" : 0,
|
|
|
|
"memory_status" : "ok",
|
2020-02-10 04:10:50 -05:00
|
|
|
"categorized_doc_count" : 0,
|
|
|
|
"total_category_count" : 0,
|
|
|
|
"frequent_category_count" : 0,
|
|
|
|
"rare_category_count" : 0,
|
|
|
|
"dead_category_count" : 0,
|
|
|
|
"categorization_status" : "ok",
|
2019-12-31 13:53:05 -05:00
|
|
|
"log_time" : 1575402237000,
|
|
|
|
"timestamp" : 1576965600000
|
2017-04-11 16:25:38 -04:00
|
|
|
},
|
2019-12-31 13:53:05 -05:00
|
|
|
"latest_record_time_stamp" : 1576971072000,
|
|
|
|
"latest_result_time_stamp" : 1576965600000,
|
2019-12-27 16:30:26 -05:00
|
|
|
"retain" : false
|
2017-04-11 16:25:38 -04:00
|
|
|
}
|
2017-04-04 18:26:39 -04:00
|
|
|
}
|
|
|
|
----
|
2019-12-31 13:53:05 -05:00
|
|
|
|
|
|
|
For a description of these properties, see the <<ml-get-snapshot-results,get model snapshots API>>.
|