Get trained model configuration info

  • GET /_ml/trained_models/{model_id}
  • GET /_ml/trained_models
Auth

Required privileges

Cluster privileges monitor_ml

Path parameters

model_id union string | string[] optional

The unique identifier of the trained model or a model alias.

You can get information for multiple trained models in a single API request by using a comma-separated list of model IDs or a wildcard expression.

Leave it out to use /_ml/trained_models.

Query parameters

allow_no_match boolean · default: true

Specifies what to do when the request:

  • Contains wildcard expressions and there are no models that match.
  • Contains the _all string or no identifiers and there are no matches.
  • Contains wildcard expressions and there are only partial matches.

If true, it returns an empty array when there are no matches and the subset of results when there are partial matches.

decompress_definition boolean · default: true

Specifies whether the included model definition should be returned as a JSON map (true) or in a custom compressed format (false).

exclude_generated boolean · default: false

Indicates if certain fields should be removed from the configuration on retrieval. This allows the configuration to be in an acceptable format to be retrieved and then added to another cluster.

from number · default: 0

Skips the specified number of models.

include enum

A comma delimited string of optional fields to include in the response body.

Supported values include:

  • definition: Includes the model definition.
  • feature_importance_baseline: Includes the baseline for feature importance values.
  • hyperparameters: Includes the information about hyperparameters used to train the model. This information consists of the value, the absolute and relative importance of the hyperparameter as well as an indicator of whether it was specified by the user or tuned during hyperparameter optimization.
  • total_feature_importance: Includes the total feature importance for the training data set. The baseline and total feature importance values are returned in the metadata field in the response body.
  • definition_status: Includes the model definition status.
Values: definition feature_importance_baseline hyperparameters total_feature_importance definition_status
size number · default: 100

Specifies the maximum number of models to obtain.

tags union string | string[]

A comma delimited string of tags. A trained model can have many tags, or none. When supplied, only trained models that contain all the supplied tags are returned.

Response

application/json
count number required
trained_model_configs object[] required

An array of trained model resources, which are sorted by the model_id value in ascending order.

model_id string required

Identifier for the trained model.

model_type enum

The model type

Supported values include:

  • tree_ensemble: The model definition is an ensemble model of decision trees.
  • lang_ident: A special type reserved for language identification models.
  • pytorch: The stored definition is a PyTorch (specifically a TorchScript) model. Currently only NLP models are supported.
Values: tree_ensemble lang_ident pytorch
tags string[] required

A comma delimited string of tags. A trained model can have many tags, or none.

version string

The Elasticsearch version number in which the trained model was created.

compressed_definition string
created_by string

Information on the creator of the trained model.

create_time union oneOf

The time when the trained model was created.

One of: string or number
default_field_map map string to string

Any field map described in the inference configuration takes precedence.

description string

The free-text description of the trained model.

estimated_heap_memory_usage_bytes number

The estimated heap usage in bytes to keep the trained model in memory.

estimated_operations number

The estimated number of operations to use the trained model.

fully_defined boolean

True if the full model definition is present.

input object required

The input field names for the model definition.

field_names string[] required

An array of input field names for the model.

license_level string

The license level of the trained model.

model_size_bytes number | string
platform_architecture string