2020-01-12 10:59:11 -05:00
|
|
|
--
|
|
|
|
:api: put-trained-model
|
|
|
|
:request: PutTrainedModelRequest
|
|
|
|
:response: PutTrainedModelResponse
|
|
|
|
--
|
|
|
|
[role="xpack"]
|
|
|
|
[id="{upid}-{api}"]
|
2020-09-04 19:57:15 -04:00
|
|
|
=== Put trained model API
|
2020-01-12 10:59:11 -05:00
|
|
|
|
|
|
|
Creates a new trained model for inference.
|
|
|
|
The API accepts a +{request}+ object as a request and returns a +{response}+.
|
|
|
|
|
|
|
|
[id="{upid}-{api}-request"]
|
2020-09-04 19:57:15 -04:00
|
|
|
==== Put trained model request
|
2020-01-12 10:59:11 -05:00
|
|
|
|
|
|
|
A +{request}+ requires the following argument:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-request]
|
|
|
|
--------------------------------------------------
|
2020-09-04 19:57:15 -04:00
|
|
|
<1> The configuration of the {infer} trained model to create
|
2020-01-12 10:59:11 -05:00
|
|
|
|
|
|
|
[id="{upid}-{api}-config"]
|
2020-09-04 19:57:15 -04:00
|
|
|
==== Trained model configuration
|
2020-01-12 10:59:11 -05:00
|
|
|
|
|
|
|
The `TrainedModelConfig` object contains all the details about the trained model
|
|
|
|
configuration and contains the following arguments:
|
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-config]
|
|
|
|
--------------------------------------------------
|
|
|
|
<1> The {infer} definition for the model
|
|
|
|
<2> Optionally, if the {infer} definition is large, you may choose to compress it for transport.
|
|
|
|
Do not supply both the compressed and uncompressed definitions.
|
|
|
|
<3> The unique model id
|
|
|
|
<4> The input field names for the model definition
|
|
|
|
<5> Optionally, a human-readable description
|
|
|
|
<6> Optionally, an object map contain metadata about the model
|
|
|
|
<7> Optionally, an array of tags to organize the model
|
2020-04-02 12:25:10 -04:00
|
|
|
<8> The default inference config to use with the model. Must match the underlying
|
|
|
|
definition target_type.
|
2020-01-12 10:59:11 -05:00
|
|
|
|
|
|
|
include::../execution.asciidoc[]
|
|
|
|
|
|
|
|
[id="{upid}-{api}-response"]
|
|
|
|
==== Response
|
|
|
|
|
|
|
|
The returned +{response}+ contains the newly created trained model.
|
2020-02-20 19:47:29 -05:00
|
|
|
The +{response}+ will omit the model definition as a precaution against
|
|
|
|
streaming large model definitions back to the client.
|
2020-01-12 10:59:11 -05:00
|
|
|
|
|
|
|
["source","java",subs="attributes,callouts,macros"]
|
|
|
|
--------------------------------------------------
|
|
|
|
include-tagged::{doc-tests-file}[{api}-response]
|
|
|
|
--------------------------------------------------
|