Logistic Regression Example

Last modified: August 20, 2024

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:

Example of the logistic regression netron.app schema.

To integrate this in a Mendix app with the Mendix Machine Learning Kit, do the following:

  1. Import the ONNX file into Studio Pro by going to Add other > ML model mapping.

  2. This creates a model mapping, as displayed in this image:

    Example of a logistic regression.
  3. 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.

  1. Use the Call ML model activity to call it in a microflow:

  2. 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:

    Details of the log message in a microflow example.
  3. You can then consume the inference output with microflow expressions, using a Create variable activity:

    Details of the log message in a microflow example.

The complete microflow for making the inference is below:

The complete microflow to predict the IRIS flower classification using logistic regression is below: