OpenSearch/docs/java-rest/high-level/ml/put-trained-model.asciidoc
Benjamin Trent 4a1610265f
[7.x] [ML] add new inference_config field to trained model config (#54421) (#54647)
* [ML] add new inference_config field to trained model config (#54421)

A new field called `inference_config` is now added to the trained model config object. This new field allows for default inference settings from analytics or some external model builder.

The inference processor can still override whatever is set as the default in the trained model config.

* fixing for backport
2020-04-02 12:25:10 -04:00

58 lines
2.0 KiB
Plaintext

--
:api: put-trained-model
:request: PutTrainedModelRequest
:response: PutTrainedModelResponse
--
[role="xpack"]
[id="{upid}-{api}"]
=== Put Trained Model API
Creates a new trained model for inference.
The API accepts a +{request}+ object as a request and returns a +{response}+.
[id="{upid}-{api}-request"]
==== Put Trained Model request
A +{request}+ requires the following argument:
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-request]
--------------------------------------------------
<1> The configuration of the {infer} Trained Model to create
[id="{upid}-{api}-config"]
==== Trained Model configuration
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
<8> The default inference config to use with the model. Must match the underlying
definition target_type.
include::../execution.asciidoc[]
[id="{upid}-{api}-response"]
==== Response
The returned +{response}+ contains the newly created trained model.
The +{response}+ will omit the model definition as a precaution against
streaming large model definitions back to the client.
["source","java",subs="attributes,callouts,macros"]
--------------------------------------------------
include-tagged::{doc-tests-file}[{api}-response]
--------------------------------------------------