`L = loss(tree,tbl,ResponseVarName)`

`L = loss(tree,x,y)`

`L = loss(___,Name,Value)`

`[L,se,NLeaf,bestlevel] = loss(___)`

returns
the mean squared error between the predictions of `L`

= loss(`tree`

,`tbl`

,`ResponseVarName`

)`tree`

to
the data in `tbl`

, compared to the true responses `tbl.ResponseVarName`

.

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.

The mean squared error *m* of the predictions *f*(*X _{n}*)
with weight vector

$$m=\frac{{\displaystyle \sum {w}_{n}{\left(f\left({X}_{n}\right)-{Y}_{n}\right)}^{2}}}{{\displaystyle \sum {w}_{n}}}.$$

Was this topic helpful?