Main Content

Resubstitution regression loss

returns the regression loss by resubstitution (L), or the in-sample regression loss, for the
trained regression model `L`

= resubLoss(`Mdl`

)`Mdl`

using the training data stored in
`Mdl.X`

and the corresponding responses stored in
`Mdl.Y`

.

The interpretation of `L`

depends on the loss function
(`'LossFun'`

) and weighting scheme (`Mdl.W`

). In
general, better models yield smaller loss values. The default `'LossFun'`

value is `'mse'`

(mean squared error).

specifies additional options using one or more name-value arguments. For example,
`L`

= resubLoss(`Mdl`

,`Name,Value`

)`'IncludeInteractions',false`

specifies to exclude interaction terms from
a generalized additive model `Mdl`

.

`resubLoss`

computes the regression loss according to the corresponding
`loss`

function of the object (`Mdl`

). For a
model-specific description, see the `loss`

function reference pages in the
following table.

Model | Regression Model Object (`Mdl` ) | `loss` Object Function |
---|---|---|

Gaussian process regression model | `RegressionGP` | `loss` |

Generalized additive model | `RegressionGAM` | `loss` |

Neural network model | `RegressionNeuralNetwork` | `loss` |

To compute the response loss for new predictor data, use the corresponding
`loss`

function of the object (`Mdl`

).