Events
31 Mar, 23 - 2 Apr, 23
The biggest Fabric, Power BI, and SQL learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Synapse Data Science in Microsoft Fabric includes autologging, which significantly reduces the amount of code required to automatically log the parameters, metrics, and items of a machine learning model during training. This article describes autologging for Synapse Data Science in Microsoft Fabric.
Autologging extends MLflow Tracking capabilities and is deeply integrated into the Synapse Data Science in Microsoft Fabric experience. Autologging can capture various metrics, including accuracy, loss, F1 score, and custom metrics you define. By using autologging, developers and data scientists can easily track and compare the performance of different models and experiments without manual tracking.
Autologging supports a wide range of machine learning frameworks, including TensorFlow, PyTorch, Scikit-learn, and XGBoost. To learn more about the framework-specific properties that autologging captures, see the MLflow documentation.
Autologging works by automatically capturing values of input parameters, output metrics, and output items of a machine learning model as it's being trained. This information is logged to your Microsoft Fabric workspace, where you can access and visualize it by using the MLflow APIs or the corresponding experiment and model items in your Microsoft Fabric workspace.
When you launch a Synapse Data Science notebook, Microsoft Fabric calls mlflow.autolog() to instantly enable tracking and load the corresponding dependencies. As you train models in your notebook, MLflow automatically tracks this model information.
The configuration happens automatically behind the scenes when you run import mlflow
. The default configuration for the notebook mlflow.autolog() hook is:
mlflow.autolog(
log_input_examples=False,
log_model_signatures=True,
log_models=True,
disable=False,
exclusive=True,
disable_for_unsupported_versions=True,
silent=True
)
To customize logging behavior, you can use the mlflow.autolog() configuration. This configuration provides parameters to enable model logging, collect input samples, configure warnings, or enable logging for added content that you specify.
For runs created with MLflow, update the MLflow autologging configuration to track additional metrics, parameters, files, and metadata as follows:
Update the mlflow.autolog() call to set exclusive=False
.
mlflow.autolog(
log_input_examples=False,
log_model_signatures=True,
log_models=True,
disable=False,
exclusive=False, # Update this property to enable custom logging
disable_for_unsupported_versions=True,
silent=True
)
Use the MLflow tracking APIs to log additional parameters and metrics. The following example code enables you to log your custom metrics and parameters alongside additional properties.
import mlflow
mlflow.autolog(exclusive=False)
with mlflow.start_run():
mlflow.log_param("parameter name", "example value")
# <add model training code here>
mlflow.log_metric("metric name", 20)
You can disable Microsoft Fabric autologging for a specific notebook session. You can also disable autologging across all notebooks by using the workspace setting.
Note
If autologging is disabled, you must manually log your parameters and metrics by using the MLflow APIs.
To disable Microsoft Fabric autologging for a specific notebook session, call mlflow.autolog() and set disable=True
.
import mlflow
mlflow.autolog(disable=True)
Workspace administrators can enable or disable Microsoft Fabric autologging for all notebooks and sessions in their workspace by using the workspace settings. To enable or disable Synapse Data Science autologging:
In your workspace, select Workspace settings.
In Workspace settings, expand Data Engineering/Science on the left navigation bar and select Spark settings.
In Spark settings, select the Automatic log tab.
Set Automatically track machine learning experiments and models to On or Off.
Select Save.
Events
31 Mar, 23 - 2 Apr, 23
The biggest Fabric, Power BI, and SQL learning event. March 31 – April 2. Use code FABINSIDER to save $400.
Register todayTraining
Module
Train and track machine learning models with MLflow in Microsoft Fabric - Training
Learn how to train machine learning models in notebooks and track your work with MLflow experiments in Microsoft Fabric.
Certification
Microsoft Certified: Azure Data Scientist Associate - Certifications
Manage data ingestion and preparation, model training and deployment, and machine learning solution monitoring with Python, Azure Machine Learning and MLflow.