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:ย 

Can we retrieve experiment results via MLflow API or is this only possible using UI?

User15787040559
Databricks Employee
Databricks Employee
1 REPLY 1

Mooune_DBU
Valued Contributor

There are many ways you can retrieve experiments results using the mlflow API (see example if you want to retrieve and display for only a specific model (assuming you have the `model_name`:

best_models = mlflow.search_runs(filter_string=f'tags.model="{model_name}" and attributes.status = "FINISHED" and metrics.F1 > 0', order_by=['metrics.F1 DESC'], max_results=1)

In Databricks my other favorite way to query runs for ad-hoc analytics is via the "mlflow-experiment" format:

df_client = spark.read.format("mlflow-experiment").load()
df_client.createOrReplaceTempView("vw_client")

Following which one can run queries slice/dice results using SparkSQL:

df_model_selector = spark.sql("""SELECT experiment_id, run_id, metrics.auc as AUC, metrics.F1 as F1, artifact_uri 
 
    FROM vw_client 
    
    WHERE status='FINISHED'
    ORDER BY metrics.f1 desc
 
  """)
display(df_model_selector)

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