Logistic Regression Example
Introduction
This document walks through the steps an example of a logistic regression model, its netron.app schema and the component display, along with the ML Mapping. Usage section of Using ML Kit lists the steps you need to get started with integrating machine learning models into Studio Pro.
Importing and Configuring the Model
The image below is the netron.app schema of a logistic regression model:
To integrate this in a Mendix app with the Mendix Machine Learning Kit, do the following:
-
Import the ONNX file into Studio Pro by going to Add other > ML model mapping.
-
This creates a model mapping, as displayed in this image:
-
Resolve any errors by configuring dynamic tensor shapes.
Using the Model
Once you have imported the model, you can start working with it by calling it in microflows.
-
Use the Call ML model activity to call it in a microflow:
-
Create pre-processed inputs with Create object activity for inference inside your Mendix app. This activity is used for the first part in order to transfer entities from the domain model to the ML model input object:
-
You can then consume the inference output with microflow expressions, using a Create variable activity:
The complete microflow for making the inference is below:
The complete microflow to predict the IRIS flower classification using logistic regression is below: