Calculate the RSS of a decision tree model.

rss(x, ...)

Arguments

x
A fitted rpart, gbm, or randomForest model
...
extra arguments

Value

The Residuals Sums of Squares (RSS) for the models `rpart`, `gbm.step`, and `randomForest`.

Note

when using the `caret` package, be sure to select `model$finalModel` when entering it into the `rss` function. Also note that the RSS only makes sense for continuous outcomes.

Examples

## Not run: ------------------------------------ # library(rpart) # # fit.rpart <- rpart(Kyphosis ~ Age + Number + Start, data = kyphosis) # # rss(fit.rpart) ## ---------------------------------------------