New predictor input values, specified as a table, dataset array, or matrix. Each row ofXNEW.corresponds to one observation, and each column corresponds to one variable.
如果XNEW.is a matrix, it must have the same number of variables (columns) in the same order as the predictor input used to createmdl。Note thatXNEW.还必须包含任何未在拟合模型中用作预测器的预测变量。此外,所有用于创建的变量mdl必须是数字。要将数字预测器视为分类,请使用的预测器'CategoricalVars'创建时的名称值对参数mdl。
For predictions without random noise, usepredictorfeval。这两个函数给出了相同的预测。
predict接受包含所有预测器变量的单个输入参数,并在其预测上给出置信区间。
feval接受具有每个预测变量的一个输入的多个输入参数。
扩展能力
C / C ++代码生成 Generate C and C++ code using MATLAB® Coder™.
使用说明和限制:
UseSavelarnerforcoder.那loadlearnerforcoder.那andCodegen.(MATLAB编码器)为此生成代码随机的功能。使用培训模型Savelarnerforcoder.。Define an entry-point function that loads the saved model by usingloadlearnerforcoder.and calls the随机的功能。然后使用Codegen.为入学点函数生成代码。
随机的可以返回比matlab的不同数量®如果以下任一项是真的:
输出是非卡尔卡尔。
输入参数对于分发无效。
此表包含有关参数的注释随机的。不包含此表中未包含的参数完全支持。金宝app
Argument
Notes and Limitations
mdl
假设您使用使用的线性模型Fitlm.并指明'抢劫'as a structure with an anonymous function handle for therobustwgtfun.field, useSavelarnerforcoder.保存模型,然后使用loadlearnerforcoder.加载模型。在这种情况下,loadlearnerforcoder.无法恢复Robust属性进入MATLAB工作区。然而,loadlearnerforcoder.can load the model at compile time within an entry-point function for code generation.
For the usage notes and limitations of the model object, see代码生成of theCompactLinearModel.目的。
XNEW.
XNEW.必须是单精度或双精度矩阵或包含数字变量,分类变量或两者的表。
The number of rows, or observations, inXNEW.can be a variable size, but the number of columns inXNEW.must be fixed.
如果you want to specifyXNEW.作为表格,那么必须使用表培训您的模型,您必须确保您的入学点函数进行预测:
接受数据作为阵列
Creates a table from the data input arguments and specifies the variable names in the table
Passes the table topredict
有关此表工作流的示例,请参阅生成代码以在表中对数据进行分类。For more information on using tables in code generation, see代码生成表格(MATLAB编码器)and代码生成的表限制(MATLAB编码器)。