Forum Discussion
How to Set Custom Artifact Path for MLflow Experiment in Microsoft Fabric?
- Anonymous1 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.
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.
Hi Mikel317 ,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.