Predict responses using support vector machine (SVM) regression model
Statistics and Machine Learning Toolbox / Regression
Import a trained SVM regression object into the block by specifying the name of a workspace variable that contains the object. The input port x receives an observation (predictor data), and the output port yfit returns a predicted response for the observation.
x — Predictor data
row vector | column vector
Predictor data, specified as a column vector or row vector of one observation.
The variables in x must have the same order as the predictor variables that trained the SVM model specified by
Select trained machine learning model.
If you set
fitrsvmwhen training the SVM model, then the RegressionSVM Predict block standardizes the values of x using the means and standard deviations in the
Sigmaproperties (respectively) of the SVM model.
Data TypesFixed-Point Operational Parameters
If you are using a linear SVM model and it has many support vectors, then prediction can be slow. To efficiently predict responses based on a linear SVM model, remove the support vectors from the
CompactRegressionSVMobject by using
You can use a MATLAB Function block with the
predict object function of an SVM regression object (
CompactRegressionSVM). For an example, see
Predict Class Labels Using MATLAB Function Block.
When deciding whether to use the RegressionSVM Predict block in the
Statistics and Machine Learning Toolbox™ library or a MATLAB Function block with the
predict function, consider
If you use the Statistics and Machine Learning Toolbox library block, you can use the Fixed-Point Tool (Fixed-Point Designer) to convert a floating-point model to fixed point.
Support for variable-size arrays must be enabled for a MATLAB Function block with the
If you use a MATLAB Function block, you can use MATLAB functions for preprocessing or post-processing before or after predictions in the same MATLAB Function block.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Design and simulate fixed-point systems using Fixed-Point Designer™.
Version HistoryIntroduced in R2020b
R2021a: Specify Kernel data type as a data type name or data type object
Behavior changed in R2021a
Starting in R2021a, the Kernel data type parameter does not support inherited options. You can specify Kernel data type as a supported data type name or data type object.
- RegressionTree Predict | RegressionEnsemble Predict | RegressionNeuralNetwork Predict | RegressionGP Predict | ClassificationSVM Predict