TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Member-only story

Interacting with sklearn machine learning models in Power BI

Mark Graus
TDS Archive
Published in
9 min readMay 24, 2023

--

In some cases we want to have a supervised learning model to play around with. While any data scientist can quite easily build an SKLearn model and play around with it in a Jupyter notebook, when you want to have other stakeholders interact with your model you will have to create a bit of a front-end. This can be done in a simple Flask webapp, providing a web interface for people to feed data into an sklearn model or pipeline to see the predicted output. This post however will focus on how to use Python visuals in Power BI to interact with a model.

The post will consist of two main parts:

  • Building the SKLearn Model / Building a Pipeline
  • Building the Power BI Interface

The code is really straightforward and you can copypaste whatever you need from this post, but it is also available on my Github. To use it, you have to do two things. Run the code in the Python Notebook to serialize the pipeline and alter the path to that pipeline in the Power BI file.

1. Building the Model

For this example we’ll use the Titanic dataset and build a simple predictive model. The model will be a classification model, using one categorical (‘sex’) and one numeric feature (‘age’) as predictors. To demonstrate the approach we…

--

--

TDS Archive
TDS Archive

Published in TDS Archive

An archive of data science, data analytics, data engineering, machine learning, and artificial intelligence writing from the former Towards Data Science Medium publication.

Mark Graus
Mark Graus

Written by Mark Graus

Human-Centric AI in Finance | Lana’s husband | Miro and Luna's dad | Cyclist | DJ | Surfer | Snowboarder

No responses yet