Forum Discussion

Mikel317's avatar
Mikel317
Frequent Visitor
1 year ago
Solved

How to Set Custom Artifact Path for MLflow Experiment in Microsoft Fabric?

Hi,   I'm trying to create an MLflow experiment in Microsoft Fabric and store artifacts in my current workspace in specific folder in Workspace (workspace/Path/to/my/folder/Experiments). How to use...
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi Mikel317  ,

     

    To store MLflow experiment artifacts in a specific folder within Microsoft Fabric using notebooks, the path "file:///absolute/path" will not work, as Microsoft Fabric uses Lakehouse storage instead of the local filesystem.

     

    In Fabric, you need to specify the Lakehouse path where your files should be stored. Please use the following format:

     

    import mlflow

    # Set the artifact location within Lakehouse

    artifact_location = '/lakehouse/default/Files/Path/to/your/folder/Experiments'

    # Create MLflow experiment

    experiment_id = mlflow.create_experiment("experiment_name", artifact_location=artifact_location)

    # Set the active experiment

    mlflow.set_experiment("experiment_name")

     

    Ensure that the specified folder path already exists in your Lakehouse Files section before creating the MLflow experiment. In Microsoft Fabric notebooks, relative paths are not supported for storing artifacts. It is recommended to use absolute Lakehouse paths that start with /lakehouse/default/Files/ to correctly reference the desired folder location. This approach will ensure that the experiment artifacts are stored in the specified folder without defaulting to the root workspace.

     

    If this helps, then please Accept it as a solution and dropping a "Kudos" so other members can find it more easily.


    Thank you.