Get trained model configuration info
- GET /_ml/trained_models/{model_id}
- GET /_ml/trained_models
Required authorization
- Cluster privileges monitor_ml
Query parameters
-
allow_no_matchboolean · 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_definitionboolean · default: true -
Specifies whether the included model definition should be returned as a JSON map (true) or in a custom compressed format (false).
-
exclude_generatedboolean · 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.
-
include -
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:
definitionfeature_importance_baselinehyperparameterstotal_feature_importancedefinition_status -
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
-
trained_model_configsobjectrequired -
An array of trained model resources, which are sorted by the model_id value in ascending order.
-
model_type -
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_ensemblelang_identpytorch -
A comma delimited string of tags. A trained model can have many tags, or none.
-
default_field_mapmap string to string -
Any field map described in the inference configuration takes precedence.
-
estimated_heap_memory_usage_bytesnumber -
The estimated heap usage in bytes to keep the trained model in memory.
-
inference_configobject -
The default configuration for inference. This can be either a regression, classification, or one of the many NLP focused configurations. It must match the underlying definition.trained_model's target_type. For pre-packaged models such as ELSER the config is not required.
-
classificationobject -
Classification configuration for inference.
-
num_top_feature_importance_valuesnumber · default: 0 -
Specifies the maximum number of feature importance values per document.
-
prediction_field_typestring -
Specifies the type of the predicted field to write. Acceptable values are: string, number, boolean. When boolean is provided 1.0 is transformed to true and 0.0 to false.
-
text_classificationobject -
Text classification configuration for inference.
-
zero_shot_classificationobject -
Zeroshot classification configuration for inference.
-
hypothesis_templatestring · default: "This example is {}." -
Hypothesis template used when tokenizing labels for prediction
-
classification_labelsstringrequired -
The zero shot classification labels indicating entailment, neutral, and contradiction Must contain exactly and only entailment, neutral, and contradiction
-
fill_maskobject -
Fill mask configuration for inference.
-
mask_tokenstring -
The string/token which will be removed from incoming documents and replaced with the inference prediction(s). In a response, this field contains the mask token for the specified model/tokenizer. Each model and tokenizer has a predefined mask token which cannot be changed. Thus, it is recommended not to set this value in requests. However, if this field is present in a request, its value must match the predefined value for that model/tokenizer, otherwise the request will fail.
-
metadataobject -
An object containing metadata about the trained model. For example, models created by data frame analytics contain analysis_config and input objects.
-
feature_importance_baselinemap string to string -
An object that contains the baseline for feature importance values. For regression analysis, it is a single value. For classification analysis, there is a value for each class.
-
hyperparametersobject -
List of the available hyperparameters optimized during the fine_parameter_tuning phase as well as specified by the user.
-
absolute_importancenumber -
A positive number showing how much the parameter influences the variation of the loss function. For hyperparameters with values that are not specified by the user but tuned during hyperparameter optimization.
-
relative_importancenumber -
A number between 0 and 1 showing the proportion of influence on the variation of the loss function among all tuned hyperparameters. For hyperparameters with values that are not specified by the user but tuned during hyperparameter optimization.
-
total_feature_importanceobject -
An array of the total feature importance for each feature used from the training data set. This array of objects is returned if data frame analytics trained the model and the request includes total_feature_importance in the include request parameter.