[ML] Add a model memory estimation endpoint for anomaly detection (#53507)

A new endpoint for estimating anomaly detection job
model memory requirements:

POST _ml/anomaly_detectors/estimate_model_memory

Closes #53219
This commit is contained in:
David Roberts 2020-03-24 21:38:19 +00:00 committed by GitHub
parent 2a67bee874
commit 8ee770560a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
14 changed files with 669 additions and 31 deletions

View file

@ -0,0 +1,42 @@
--
:api: estimate-model-memory
:request: EstimateModelMemoryRequest
:response: EstimateModelMemoryResponse
--
[role="xpack"]
[id="{upid}-{api}"]
=== Estimate {anomaly-job} model memory API
Estimate the model memory an analysis config is likely to need for
the given cardinality of the fields it references.
[id="{upid}-{api}-request"]
==== Estimate {anomaly-job} model memory request
A +{request}+ can be set up as follows:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request]
--------------------------------------------------
<1> Pass an `AnalysisConfig` to the constructor.
<2> For any `by_field_name`, `over_field_name` or
`partition_field_name` fields referenced by the
detectors, supply overall cardinality estimates
in a `Map`.
<3> For any `influencers`, supply a `Map` containing
estimates of the highest cardinality expected in
any single bucket.
include::../execution.asciidoc[]
[id="{upid}-{api}-response"]
==== Estimate {anomaly-job} model memory response
The returned +{response}+ contains the model memory estimate:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-response]
--------------------------------------------------
<1> The model memory estimate.

View file

@ -295,6 +295,7 @@ The Java High Level REST Client supports the following Machine Learning APIs:
* <<{upid}-put-calendar-job>>
* <<{upid}-delete-calendar-job>>
* <<{upid}-delete-calendar>>
* <<{upid}-estimate-model-memory>>
* <<{upid}-get-data-frame-analytics>>
* <<{upid}-get-data-frame-analytics-stats>>
* <<{upid}-put-data-frame-analytics>>
@ -351,6 +352,7 @@ include::ml/delete-calendar-event.asciidoc[]
include::ml/put-calendar-job.asciidoc[]
include::ml/delete-calendar-job.asciidoc[]
include::ml/delete-calendar.asciidoc[]
include::ml/estimate-model-memory.asciidoc[]
include::ml/get-data-frame-analytics.asciidoc[]
include::ml/get-data-frame-analytics-stats.asciidoc[]
include::ml/put-data-frame-analytics.asciidoc[]