Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete an experiment from an azure machine learning workspace

I create experiments in my workspace using the python sdk (azureml-sdk). I now have a lot of 'test' experiments littering our workspace. How can I delete individual experiments either through the api or on the portal. I know I can delete the whole workspace but there are some good experiments we don't want to delete

https://docs.microsoft.com/en-us/azure/machine-learning/service/how-to-export-delete-data#delete-visual-interface-assets suggests it is possible but my workspace view does not look anything like what is shown there

like image 355
mike Avatar asked Aug 14 '19 15:08

mike


2 Answers

Experiment deletion is a common request and we in Azure ML team are working on it. Unfortunately it's not supported quite yet.

like image 128
Roope Astala - MSFT Avatar answered Oct 20 '22 04:10

Roope Astala - MSFT


Starting from 2021-08-24 Azure ML Workspace release you can delete the experiment - but only by clicking in UI (Select Experiment in Experiments view -> 'Delete')

Watch out - deleting the experiment will delete all the underlying runs - and deleting a run will delete the child runs, run metrics, metadata, outputs, logs and working directories!

Only for experiments without any underlying runs you can use Python SDK (azureml-core==1.34.0) - Experiment class delete static method, example:

from azureml.core import Workspace, Experiment

aml_workspace = Workspace.from_config()
experiment_id = Experiment(aml_workspace, '<experiment_name>').id

Experiment.delete(aml_workspace, experiment_id)

If an experiment has runs you will get an error:

CloudError: Azure Error: UserError
Message: Only empty Experiments can be deleted. This experiment contains run(s)

I hope Azure ML team gets this functionality to Python SDK soon!

Also on a sad note - would be great if you optimize the deletion - for now it seems like extremely slow (implementation) synchronous (need async as well) call...

like image 27
Wiktor Madejski Avatar answered Oct 20 '22 05:10

Wiktor Madejski