regression model in simulink function block
5 views (last 30 days)
Show older comments
Hi everyone. I need your help please . now for more than two weeks I cannot resolve the issue I have. I have trained a model for regression in regression learner and I have exported the trained model to my workspace and saved it as required and I have created a function to predict as mentioned in matlab website but when I use it in the simulink function block It doesnt work I have tried all possible ways mentioned in matlab website. please help. thanks
2 Comments
Sulaymon Eshkabilov
on 30 Oct 2023
Some clarifcations are needed.
Q1: Can you share your model?
Q2: what simulink fcn were you trying to use?
Q3: what execise are you referring in MathWorks website or help documentation?
Answers (1)
Drew
on 3 Nov 2023
MathWorks provides Simulink blocks for machine learning model prediction. So, rather than using a generic MATLAB function block for the model prediction, you can use the native Simulink block designed for model prediction for your machine learning model. Check the "Blocks" section of the doc page https://www.mathworks.com/help/stats/code-generation.html.
Given that your model is named "boosted_trees_model.mat", the matching Simulink block is probably the "RegressionEnsemble Predict" block:
- RegressionEnsemble Predict Predict responses using ensemble of decision trees for regression (Since R2021a)
If this answer helps you, please remember to accept the answer.
See Also
Categories
Find more on Regression Tree Ensembles in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!