This documentation contains work-in-progress information for future Elastic Stack and Cloud releases. Use the version selector to view supported release docs. It also contains some Elastic Cloud serverless information. Check out our serverless docs for more details.
Delete trained models API
editDelete trained models API
editDeletes an existing trained inference model.
Request
editDELETE _ml/trained_models/<model_id>
Prerequisites
editRequires the manage_ml
cluster privilege. This privilege is included in the
machine_learning_admin
built-in role.
Path parameters
edit-
<model_id>
- (Optional, string) The unique identifier of the trained model.
Query parameters
edit-
force
- (Optional, Boolean) Use to forcefully delete a trained model that is referenced by ingest pipelines or has a started deployment.
Response codes
edit-
409
- The code indicates that the trained model is referenced by an ingest pipeline and cannot be deleted.
Examples
editThe 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 }