Get trained model configuration info Generally available; Added in 7.10.0
Path parameters
-
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.
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.
-
Skips the specified number of models.
-
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 are
definition
,feature_importance_baseline
,hyperparameters
,total_feature_importance
, ordefinition_status
. -
Specifies the maximum number of models to obtain.
GET _ml/trained_models/
resp = client.ml.get_trained_models()
const response = await client.ml.getTrainedModels();
response = client.ml.get_trained_models
$resp = $client->ml()->getTrainedModels();
curl -X GET -H "Authorization: ApiKey $ELASTIC_API_KEY" "$ELASTICSEARCH_URL/_ml/trained_models/"
client.ml().getTrainedModels(g -> g);