loss
Regression error
Syntax
L = loss(ens,tbl,ResponseVarName)
L = loss(ens,tbl,Y)
L = loss(ens,X,Y)
L = loss(___,Name,Value)
Description
returns the mean squared error between the predictions of L
= loss(ens
,tbl
,ResponseVarName
)ens
to the
data in tbl
, compared to the true responses
tbl.ResponseVarName
.
returns the mean squared error between the predictions of L
= loss(ens
,tbl
,Y
)ens
to the
data in tbl
, compared to the true responses
Y
.
returns the mean squared error between the predictions of L
= loss(ens
,X
,Y
)ens
to the
data in X
, compared to the true responses
Y
.
computes the error in prediction with additional options specified by one or more
L
= loss(___,Name,Value
)Name,Value
pair arguments, using any of the previous
syntaxes.
Input Arguments

A regression ensemble created with 

Sample data, specified as a table. Each row of If you trained 

Response variable name, specified as the name of a variable in
You must specify 

A matrix of predictor values. Each column of If you trained 

A numeric column vector with the same number of rows as

NameValue Arguments
Specify optional pairs of arguments as
Name1=Value1,...,NameN=ValueN
, where Name
is
the argument name and Value
is the corresponding value.
Namevalue arguments must appear after other arguments, but the order of the
pairs does not matter.
Before R2021a, use commas to separate each name and value, and enclose
Name
in quotes.
 Indices of weak learners in the ensemble ranging from Default: 

Function handle for loss function, or fun(Y,Yfit,W) where
The returned value Default: 

Meaning of the output
Default: 

A logical matrix of size
Default: 
 Indication to perform inference in parallel, specified as Default: 

Numeric vector of observation weights with the same number of elements
as Default: 
Output Arguments

Weighted mean squared error of predictions. The formula for
