Load ML trained model objects in Simulink data dictionary

4 visualizzazioni (ultimi 30 giorni)
Hi,
is there a way to load some ML learning trained regression/classification model objects in Simulink data dictionary, in order to call them in Simulink using the dedicated "Predict" block?
Thank you in advance.

Risposte (2)

Aditya
Aditya il 21 Nov 2024
Hi Davide,
You can refer to the following MATLAB Answers post, as it closely matches your use case:
The post includes several examples demonstrating how to achieve the desired behavior in MATLAB.
Hope it helps!
  1 Commento
Davide Galli
Davide Galli il 22 Nov 2024
Hi Aditya,
thank you for your answer. It is clear to me how to load trained model objects in order to use them in Simulink with the proper blockset. I was asking about the possibility to load them in Simulink data dictionary. Is this explained somewhere in the link attached in your answer? I am not able to find nothing about this.

Accedi per commentare.


Jaimin
Jaimin il 26 Nov 2024
Modificato: Jaimin il 26 Nov 2024
You can import trained machine learning models into a Simulink data dictionary and utilize them with the Predict block in Simulink. Here is a general workflow to accomplish this:
  1. Train your regression or classification model in MATLAB using the appropriate toolbox, such as the Statistics and Machine Learning Toolbox or the Deep Learning Toolbox, and save the trained model object to a.matfile using thesavefunction.
  2. Open your Simulink model, access the Simulink Data Dictionary, and import the .mat file with your trained model.
  3. Add the "Predict" block from the Simulink library to your model and configure it to use the loaded model by selecting it from the data dictionary.
  4. Connect inputs to the Predict block according to your model's requirements.
For more information kindly refer following MathWorks Documentation.
I hope this will be helpful.
  1 Commento
Davide Galli
Davide Galli il 2 Dic 2024
Hi Jaimin,
that is the workflow I supposed to do but once I try to import the .mat file by right clicking on "Design Data" of my data dictionary the window reported below appears:
Does the workflow you mentioned work for you?

Accedi per commentare.

Categorie

Scopri di più su Predictive Maintenance Toolbox in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by