Advent of 2023, Day 13 – Creating ML Model with Microsoft Fabric

In this Microsoft Fabric series:

  1. Dec 01: What is Microsoft Fabric?
  2. Dec 02: Getting started with Microsoft Fabric
  3. Dec 03: What is lakehouse in Fabric?
  4. Dec 04: Delta lake and delta tables in Microsoft Fabric
  5. Dec 05: Getting data into lakehouse
  6. Dec 06: SQL Analytics endpoint
  7. Dec 07: SQL commands in SQL Analytics endpoint
  8. Dec 08: Using Lakehouse REST API
  9. Dec 09: Building custom environments
  10. Dec 10: Creating Job Spark definition
  11. Dec 11: Starting data science with Microsoft Fabric
  12. Dec 12: Creating data science experiments with Microsoft Fabric

Yesterday, we created an MLFlow experiment and today we will look into creating an ML model.

Create a new ML model, and give it a name. You will have the option to select the following:

Since we have created an experiment yesterday, let’s open it. And you will be greeted with the familiar interface.

Of course, you can always explore the model, even download the model and all the artefacts for building a new model:

Protip: Both experiments and the ML model version look similar, and you can intuitively switch between both of them. But do not get confused, as the ML Model version applies the best-selected model from the experiment and can be used for inference.

In the view runs, you can compare different runs and check the metrics, logs and model performance.

Pretty handy tools. As said, With the model, you can also apply the model to start making the predictions. You can create a new ML Model version and you will also be able to choose the version of the model and apply the version!

And use MLFlow to read the model, make inference on delta table and store results in a new delta table.

import mlflow
from synapse.ml.predict import MLFlowTransformer
    
df = spark.read.format("delta").load("Advent2023/Tables/iris_data")
    
model = MLFlowTransformer(
    inputCols=["Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width"], 
    outputCol="predictions", 
    modelName="Advent2023_MLmodel",
    modelVersion="Version 1")
df = model.transform(df)

This will make the model persistent and prediction available in the table.

Tomorrow we will start looking into the data warehouse.

Complete set of code, documents, notebooks, and all of the materials will be available at the Github repository: https://github.com/tomaztk/Microsoft-Fabric

Happy Advent of 2023! 🙂

Tagged with: , , , , , , ,
Posted in Azure Machine Learning, Fabric, Spark
13 comments on “Advent of 2023, Day 13 – Creating ML Model with Microsoft Fabric
  1. […] Dec 13: Creating ML Model with Microsoft Fabric […]

    Like

  2. […] Tomaz Kastrun continues a series on Microsoft Fabric. First up is creating ML models: […]

    Like

  3. […] Dec 13: Creating ML Model with Microsoft Fabric […]

    Like

  4. […] Dec 13: Creating ML Model with Microsoft Fabric […]

    Like

  5. […] Dec 13: Creating ML Model with Microsoft Fabric […]

    Like

  6. […] Dec 13: Creating ML Model with Microsoft Fabric […]

    Like

  7. […] Dec 13: Creating ML Model with Microsoft Fabric […]

    Like

  8. […] Dec 13: Creating ML Model with Microsoft Fabric […]

    Like

  9. […] Dec 13: Creating ML Model with Microsoft Fabric […]

    Like

  10. […] Dec 13: Creating ML Model with Microsoft Fabric […]

    Like

Leave a comment

Follow TomazTsql on WordPress.com
Programs I Use: SQL Search
Programs I Use: R Studio
Programs I Use: Plan Explorer
Rdeči Noski – Charity

Rdeči noski

100% of donations made here go to charity, no deductions, no fees. For CLOWNDOCTORS - encouraging more joy and happiness to children staying in hospitals (http://www.rednoses.eu/red-noses-organisations/slovenia/)

€2.00

Top SQL Server Bloggers 2018
TomazTsql

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

Discover WordPress

A daily selection of the best content published on WordPress, collected for you by humans who love to read.

Revolutions

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

Reeves Smith's SQL & BI Blog

A blog about SQL Server and the Microsoft Business Intelligence stack with some random Non-Microsoft tools thrown in for good measure.

SQL Server

for Application Developers

Business Analytics 3.0

Data Driven Business Models

SQL Database Engine Blog

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

Search Msdn

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

R-bloggers

Tomaz doing BI and DEV with SQL Server and R, Python, Power BI, Azure and beyond

Data Until I Die!

Data for Life :)

Paul Turley's SQL Server BI Blog

sharing my experiences with the Microsoft data platform, Fabric, enterprise Power BI, SQL Server BI, Data Modeling, SSAS Design, SSRS, Dashboards & Visualization since 2009

Grant Fritchey

Intimidating Databases and Code

Madhivanan's SQL blog

A modern business theme

Alessandro Alpi's Blog

DevOps could be the disease you die with, but don’t die of.

Paul te Braak

Business Intelligence Blog

Sql Insane Asylum (A Blog by Pat Wright)

Information about SQL (PostgreSQL & SQL Server) from the Asylum.

Gareth's Blog

A blog about Life, SQL & Everything ...

SQLPam's Blog

Life changes fast and this is where I occasionally take time to ponder what I have learned and experienced. A lot of focus will be on SQL and the SQL community – but life varies.

William Durkin

William Durkin a blog on SQL Server, Replication, Performance Tuning and whatever else.

$hell Your Experience !!!

As aventuras de um DBA usando o Poder do $hell

Design a site like this with WordPress.com
Get started