File size: 967 Bytes
280f57f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# app.py
import streamlit as st
import mlflow
import pandas as pd

# Set the MLflow tracking URI (e.g., local file system or a remote server)
mlflow.set_tracking_uri("http://localhost:5000")

def main():
    st.title("Streamlit and MLflow Integration")

    # Retrieve the list of experiments
    experiments = mlflow.list_experiments()
    experiment_names = [exp.name for exp in experiments]
    experiment_id_map = {exp.name: exp.experiment_id for exp in experiments}

    # Create a dropdown menu to select an experiment
    selected_experiment = st.selectbox("Select an experiment:", experiment_names)

    # Get the runs for the selected experiment
    if selected_experiment:
        experiment_id = experiment_id_map[selected_experiment]
        runs = mlflow.search_runs(experiment_ids=[experiment_id])

        # Display the runs in a table
        st.write("Runs for the selected experiment:")
        st.write(runs)

if __name__ == "__main__":
    main()