cancel
Showing results for 
Search instead for 
Did you mean: 
Machine Learning
Dive into the world of machine learning on the Databricks platform. Explore discussions on algorithms, model training, deployment, and more. Connect with ML enthusiasts and experts.
cancel
Showing results for 
Search instead for 
Did you mean: 

How to search the run id of an experiment run created in another notebook?

yorabhir
New Contributor III

Hello,

I have created an experiment using 

with mlflow.start_run(run_name='experment_1'):

in a notebook say 'notebook_1'.  In the 'Experiments' tab if I click on 'notebook_1', I am able to see 'experiment_1'.
 
Now I am trying to search the experiment in another notebook using
mlflow.search_runs(filter_string='tags.mlflow.runName = "experiment_1"') which is giving me None but if I run the same in 'notebook_1' I am able to see the details of the run (even after I Detach & re-attach or restart the cluster)

I have also tried 
mlflow.search_experiments(filter_string="name = 'experiment_1'") and MlflowClient.search_experiments(filter_string="name = 'experiment_1'") but they also giving output None.

1 ACCEPTED SOLUTION

Accepted Solutions

atmcqueen
New Contributor III

Hi,

I believe the run name is an attribute, not a tag.

Try:
my_run = mlflow.search_runs(
search_all_experiments=True,
filter_string="attributes.run_name='experiment_1'"
)

To search for runs in specific notebooks, you can add "tags.environment='notebook_name'" to the filter string, so the filter string would then be:
"attributes.run_name='experiment_1' AND tags.enviroment='your_notebook'"

I think your issue with using search_experiments() was that you were providing the name of the run and not the name of the experiment, though I'm not sure if you were using the same name for both.

Here are the docs for mlflow.search_runs() and mlflow.search_experiments().

Hope this helps.

View solution in original post

2 REPLIES 2

atmcqueen
New Contributor III

Hi,

I believe the run name is an attribute, not a tag.

Try:
my_run = mlflow.search_runs(
search_all_experiments=True,
filter_string="attributes.run_name='experiment_1'"
)

To search for runs in specific notebooks, you can add "tags.environment='notebook_name'" to the filter string, so the filter string would then be:
"attributes.run_name='experiment_1' AND tags.enviroment='your_notebook'"

I think your issue with using search_experiments() was that you were providing the name of the run and not the name of the experiment, though I'm not sure if you were using the same name for both.

Here are the docs for mlflow.search_runs() and mlflow.search_experiments().

Hope this helps.

yorabhir
New Contributor III

Thank you @atmcqueen , the solution is working.

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you won’t want to miss the chance to attend and share knowledge.

If there isn’t a group near you, start one and help create a community that brings people together.

Request a New Group