Spec-Zone.ru › Elasticsearch 8
›Elasticsearch Guide [8.17] ›REST APIs ›Machine learning trained model APIs

Delete trained models API

New API reference

For the most up-to-date API details, refer to Machine learning trained model APIs.

Deletes an existing trained inference model.

Request

DELETE _ml/trained_models/<model_id>

Prerequisites

Requires the manage_ml cluster privilege. This privilege is included in the machine_learning_admin built-in role.

Path parameters

<model_id>
(Optional, string) The unique identifier of the trained model.

Query parameters

force
(Optional, Boolean) Use to forcefully delete a trained model that is referenced by ingest pipelines or has a started deployment.

Response codes

409
The code indicates that the trained model is referenced by an ingest pipeline and cannot be deleted.

Examples

The following example deletes the regression-job-one-1574775307356 trained model:

resp = client.ml.delete_trained_model(
    model_id="regression-job-one-1574775307356",
)
print(resp)
response = client.ml.delete_trained_model(
  model_id: 'regression-job-one-1574775307356'
)
puts response
const response = await client.ml.deleteTrainedModel({
  model_id: "regression-job-one-1574775307356",
});
console.log(response);
DELETE _ml/trained_models/regression-job-one-1574775307356

The API returns the following result:

{
  "acknowledged" : true
}

© 2023-2025 Elasticsearch
As of September 2024, Elasticsearch is available under a choice of three licenses: the Server Side Public License (SSPL), the Elastic License, or the AGPLv3 (OSI approved).
Elasticsearch and the Elasticsearch logo are trademarks of Elasticsearch B.V., registered in the U.S. and in other countries.
https://www.elastic.co/guide/en/elasticsearch/reference/8.17/delete-trained-models.html

Spec-Zone.ru

Настройки Оффлайн Что нового Помощь О нас
Spec-Zone .ru
спецификации, руководства, описания, API