Adding a Machine Learning model made with Python into your Mendix app

0
We’re building a website that will need to integrate a Machine Learning model (that has been coded in Python), and I’m not sure how we can do this. My initial idea was to create an API following something like this (https://ubiops.com/building-a-low-code-app-powered-by-ai/), but I don’t want to rely on external tools like UbiOps. So I tried to make my own Python API from scratch using Flask, like here (https://www.datacamp.com/community/tutorials/machine-learning-models-api-python). The API is functional, but I’m not sure how to pass the input from Mendix. I try using the “call REST” action in a microflow, using a POST method, but it seems I can’t get it to pass the input. I’m trying to use an export mapping to pass the JSON you see in the previous link, but I don’t find any documentation to do this. There’s also the idea to call a Java action, that will in turn call the  Python model, like they mention here (https://community.mendix.com/link/questions/101581). I haven’t tried this yet, though. Any idea what would be the best way to proceed?
asked
3 answers
0

If you go into your Mendix console, and set the Log Level for the “REST Consume” node to “TRACE” you can see the request and response when Mendix tries to call the service you’ve built. This should let you know what is going on. Can you share an example request and response if you are still stuck?

answered
0

Hi Alfonso, 

In all honesty, I am a bit biased as I work for UbiOps. I was triggered by your comment that you do not want to rely on an external tool for serving your python model. Really curious to learn about your thoughts on this. Maybe we can help still, as UbiOps also comes in an on-premise version, which you can run on your own cluster.

Fully understand if you want to continue using your own setup. In that case we might still be able to help by sharing our experience with Mendix integrations.

If you are open to discuss, let me know. 
 

answered
0

The newly announced Machine learning toolkit (announced at Mx World 21) will allow you to import ML Models directly into the platform, which may help you in future. 

I’d recommend watching the CTO Keynote 34 minutes onwards demos this feature: 
Mendix World 2021 | Session Catalog

 

Release dates for the features are available here: Feature Release Calendar (MxWorld 2021) - Release Notes | Mendix Documentation

For organizations looking to incorporate custom machine learning models into their Mendix-developed apps, den Haan also announced the Mendix Machine Learning (ML) Kit.  This is a key capability when business processes and end-user satisfaction rely on specialized machine learning models, such as ones that execute over a proprietary data set or key off a custom parameter.

With the ML Kit, Mendix is applying low-code’s abstraction and automation to the often complex and cumbersome integration of AI models.  Eschewing the typical complexities of REST services and APIs, the ML Kit supports drag-and-drop of machine learning models, with automatic translation and execution. Said den Haan, “Assembling purpose-built, relevant apps becomes easier for developers, and the applications themselves provide more value to the end users.”

https://www.mendix.com/press/mendix-puts-intelligent-solutions-in-the-hands-of-all-software-developers/

 

answered