Get trained model configuration info Added in 7.10.0

GET /_ml/trained_models

Query parameters

  • 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.

  • Specifies whether the included model definition should be returned as a JSON map (true) or in a custom compressed format (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

    Skips the specified number of models.

  • include string

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

    Values are definition, feature_importance_baseline, hyperparameters, total_feature_importance, or definition_status.

  • size number

    Specifies the maximum number of models to obtain.

  • tags string | array[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.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • count number Required
    • trained_model_configs array[object] Required

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

      Hide trained_model_configs attributes Show trained_model_configs attributes object
      • model_id string Required
      • Values are tree_ensemble, lang_ident, or pytorch.

      • tags array[string] Required

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

      • version string
      • Information on the creator of the trained model.

      • create_time string | number

        A date and time, either as a string whose format can depend on the context (defaulting to ISO 8601), or a number of milliseconds since the Epoch. Elasticsearch accepts both as input, but will generally output a string representation.

      • Any field map described in the inference configuration takes precedence.

        Hide default_field_map attribute Show default_field_map attribute object
        • * string Additional properties
      • The free-text description of the trained model.

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

      • The estimated number of operations to use the trained model.

      • True if the full model definition is present.

      • Inference configuration provided when storing the model config

        Additional properties are allowed.

        Hide inference_config attributes Show inference_config attributes object
        • Additional properties are allowed.

          Hide regression attributes Show regression attributes object
        • Additional properties are allowed.

          Hide classification attributes Show classification attributes object
          • Specifies the number of top class predictions to return. Defaults to 0.

          • Specifies the maximum number of feature importance values per document.

          • 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.

          • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • Specifies the field to which the top classes are written. Defaults to top_classes.

        • Additional properties are allowed.

          Hide text_classification attributes Show text_classification attributes object
          • Specifies the number of top class predictions to return. Defaults to 0.

          • Tokenization options stored in inference configuration

            Additional properties are allowed.

            Hide tokenization attributes Show tokenization attributes object
            • bert object

              Additional properties are allowed.

            • mpnet object

              Additional properties are allowed.

            • roberta object

              Additional properties are allowed.

          • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • Classification labels to apply other than the stored labels. Must have the same deminsions as the default configured labels

        • Additional properties are allowed.

          Hide zero_shot_classification attributes Show zero_shot_classification attributes object
          • Tokenization options stored in inference configuration

            Additional properties are allowed.

            Hide tokenization attributes Show tokenization attributes object
            • bert object

              Additional properties are allowed.

            • mpnet object

              Additional properties are allowed.

            • roberta object

              Additional properties are allowed.

          • Hypothesis template used when tokenizing labels for prediction

          • classification_labels array[string] Required

            The zero shot classification labels indicating entailment, neutral, and contradiction Must contain exactly and only entailment, neutral, and contradiction

          • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • Indicates if more than one true label exists.

          • labels array[string]

            The labels to predict.

        • Additional properties are allowed.

          Hide fill_mask attributes Show fill_mask attributes object
          • 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.

          • Specifies the number of top class predictions to return. Defaults to 0.

          • Tokenization options stored in inference configuration

            Additional properties are allowed.

            Hide tokenization attributes Show tokenization attributes object
            • bert object

              Additional properties are allowed.

            • mpnet object

              Additional properties are allowed.

            • roberta object

              Additional properties are allowed.

          • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

        • ner object

          Additional properties are allowed.

          Hide ner attributes Show ner attributes object
          • Tokenization options stored in inference configuration

            Additional properties are allowed.

            Hide tokenization attributes Show tokenization attributes object
            • bert object

              Additional properties are allowed.

            • mpnet object

              Additional properties are allowed.

            • roberta object

              Additional properties are allowed.

          • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • The token classification labels. Must be IOB formatted tags

          • Additional properties are allowed.

            Hide vocabulary attribute Show vocabulary attribute object
        • Additional properties are allowed.

          Hide pass_through attributes Show pass_through attributes object
          • Tokenization options stored in inference configuration

            Additional properties are allowed.

            Hide tokenization attributes Show tokenization attributes object
            • bert object

              Additional properties are allowed.

            • mpnet object

              Additional properties are allowed.

            • roberta object

              Additional properties are allowed.

          • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • Additional properties are allowed.

            Hide vocabulary attribute Show vocabulary attribute object
        • Additional properties are allowed.

          Hide text_embedding attributes Show text_embedding attributes object
          • The number of dimensions in the embedding output

          • Tokenization options stored in inference configuration

            Additional properties are allowed.

            Hide tokenization attributes Show tokenization attributes object
            • bert object

              Additional properties are allowed.

            • mpnet object

              Additional properties are allowed.

            • roberta object

              Additional properties are allowed.

          • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

        • Additional properties are allowed.

          Hide text_expansion attributes Show text_expansion attributes object
          • Tokenization options stored in inference configuration

            Additional properties are allowed.

            Hide tokenization attributes Show tokenization attributes object
            • bert object

              Additional properties are allowed.

            • mpnet object

              Additional properties are allowed.

            • roberta object

              Additional properties are allowed.

          • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

        • Additional properties are allowed.

          Hide question_answering attributes Show question_answering attributes object
          • Specifies the number of top class predictions to return. Defaults to 0.

          • Tokenization options stored in inference configuration

            Additional properties are allowed.

            Hide tokenization attributes Show tokenization attributes object
            • bert object

              Additional properties are allowed.

            • mpnet object

              Additional properties are allowed.

            • roberta object

              Additional properties are allowed.

          • The field that is added to incoming documents to contain the inference prediction. Defaults to predicted_value.

          • The maximum answer length to consider

      • input object Required

        Additional properties are allowed.

        Hide input attribute Show input attribute object
        • field_names array[string] Required

          Path to field or array of paths. Some API's support wildcards in the path to select multiple fields.

      • The license level of the trained model.

      • metadata object

        Additional properties are allowed.

        Hide metadata attributes Show metadata attributes object
        • model_aliases array[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.

          Hide feature_importance_baseline attribute Show feature_importance_baseline attribute object
          • * string Additional properties
        • hyperparameters array[object]

          List of the available hyperparameters optimized during the fine_parameter_tuning phase as well as specified by the user.

          Hide hyperparameters attributes Show hyperparameters attributes object
          • 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.

          • name string Required
          • 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.

          • supplied boolean Required

            Indicates if the hyperparameter is specified by the user (true) or optimized (false).

          • value number Required

            The value of the hyperparameter, either optimized or specified by the user.

        • 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.

          Hide total_feature_importance attributes Show total_feature_importance attributes object
          • feature_name string Required
          • importance array[object] Required

            A collection of feature importance statistics related to the training data set for this particular feature.

          • classes array[object] Required

            If the trained model is a classification model, feature importance statistics are gathered per target class value.

      • location object

        Additional properties are allowed.

        Hide location attribute Show location attribute object
        • index object Required

          Additional properties are allowed.

          Hide index attribute Show index attribute object
      • Additional properties are allowed.

        Hide prefix_strings attributes Show prefix_strings attributes object
        • ingest string

          String prepended to input at ingest

GET /_ml/trained_models
curl \
 -X GET http://api.example.com/_ml/trained_models
Response examples (200)
{
  "count": 42.0,
  "trained_model_configs": [
    {
      "model_id": "string",
      "model_type": "tree_ensemble",
      "tags": [
        "string"
      ],
      "version": "string",
      "compressed_definition": "string",
      "created_by": "string",
      "": 42.0,
      "default_field_map": {
        "additionalProperty1": "string",
        "additionalProperty2": "string"
      },
      "description": "string",
      "estimated_heap_memory_usage_bytes": 42.0,
      "estimated_operations": 42.0,
      "fully_defined": true,
      "inference_config": {
        "regression": {
          "results_field": "string",
          "num_top_feature_importance_values": 42.0
        },
        "classification": {
          "num_top_classes": 42.0,
          "num_top_feature_importance_values": 42.0,
          "prediction_field_type": "string",
          "results_field": "string",
          "top_classes_results_field": "string"
        },
        "text_classification": {
          "num_top_classes": 42.0,
          "tokenization": {
            "bert": {},
            "mpnet": {},
            "roberta": {}
          },
          "results_field": "string",
          "classification_labels": [
            "string"
          ]
        },
        "zero_shot_classification": {
          "tokenization": {
            "bert": {},
            "mpnet": {},
            "roberta": {}
          },
          "hypothesis_template": "string",
          "classification_labels": [
            "string"
          ],
          "results_field": "string",
          "multi_label": true,
          "labels": [
            "string"
          ]
        },
        "fill_mask": {
          "mask_token": "string",
          "num_top_classes": 42.0,
          "tokenization": {
            "bert": {},
            "mpnet": {},
            "roberta": {}
          },
          "results_field": "string"
        },
        "ner": {
          "tokenization": {
            "bert": {},
            "mpnet": {},
            "roberta": {}
          },
          "results_field": "string",
          "classification_labels": [
            "string"
          ],
          "vocabulary": {
            "index": "string"
          }
        },
        "pass_through": {
          "tokenization": {
            "bert": {},
            "mpnet": {},
            "roberta": {}
          },
          "results_field": "string",
          "vocabulary": {
            "index": "string"
          }
        },
        "text_embedding": {
          "embedding_size": 42.0,
          "tokenization": {
            "bert": {},
            "mpnet": {},
            "roberta": {}
          },
          "results_field": "string"
        },
        "text_expansion": {
          "tokenization": {
            "bert": {},
            "mpnet": {},
            "roberta": {}
          },
          "results_field": "string"
        },
        "question_answering": {
          "num_top_classes": 42.0,
          "tokenization": {
            "bert": {},
            "mpnet": {},
            "roberta": {}
          },
          "results_field": "string",
          "max_answer_length": 42.0
        }
      },
      "input": {
        "field_names": [
          "string"
        ]
      },
      "license_level": "string",
      "metadata": {
        "model_aliases": [
          "string"
        ],
        "feature_importance_baseline": {
          "additionalProperty1": "string",
          "additionalProperty2": "string"
        },
        "hyperparameters": [
          {
            "absolute_importance": 42.0,
            "name": "string",
            "relative_importance": 42.0,
            "supplied": true,
            "value": 42.0
          }
        ],
        "total_feature_importance": [
          {
            "feature_name": "string",
            "importance": [
              {}
            ],
            "classes": [
              {}
            ]
          }
        ]
      },
      "location": {
        "index": {
          "name": "string"
        }
      },
      "prefix_strings": {
        "ingest": "string",
        "search": "string"
      }
    }
  ]
}