A coder configurer offers convenient features to configure code generation options, generate C/C++ code, and update model parameters in the generated code.
Configure code generation options and specify the coder attributes of model parameters using object properties.
Generate C/C++ code for the predict
and update
functions of the model by using generateCode
.
This requires MATLAB®
Coder™.
Update model parameters in the generated C/C++ code without having to regenerate the
code. This feature reduces the effort required to regenerate, redeploy, and reverify
C/C++ code when you retrain the model with new data or settings. Before updating model
parameters, use validatedUpdateInputs
to validate and extract the model parameters to
update.
This flow chart shows the code generation workflow for the predict
and update
functions
using a coder configurer.
This table shows coder configurer objects corresponding to the supported machine learning models.
Model | Coder Configurer Object |
---|---|
Binary decision tree for multiclass classification | ClassificationTreeCoderConfigurer |
SVM for one-class and binary classification | ClassificationSVMCoderConfigurer |
Linear model for binary classification | ClassificationLinearCoderConfigurer |
Multiclass model for SVMs and linear models | ClassificationECOCCoderConfigurer |
Binary decision tree for regression | RegressionTreeCoderConfigurer |
Support vector machine (SVM) regression | RegressionSVMCoderConfigurer |
Linear regression | RegressionLinearCoderConfigurer |
For details and examples, see the reference pages for the coder configurer objects.
generateCode
| generateFiles
| learnerCoderConfigurer
| update
| validatedUpdateInputs