View source: R/methods_e2tree.R
| residuals.e2tree | R Documentation |
Returns the residuals (observed minus fitted) for regression E2Tree models. Not available for classification models.
## S3 method for class 'e2tree'
residuals(object, ...)
object |
An e2tree object. |
... |
Additional arguments (ignored). |
A numeric vector of residuals.
data("mtcars")
smp_size <- floor(0.75 * nrow(mtcars))
train_ind <- sample(seq_len(nrow(mtcars)), size = smp_size)
training <- mtcars[train_ind, ]
ensemble <- randomForest::randomForest(mpg ~ ., data = training, ntree = 500,
importance = TRUE, proximity = TRUE)
D <- createDisMatrix(ensemble, data = training, label = "mpg",
parallel = list(active = FALSE, no_cores = 1))
setting <- list(impTotal = 0.1, maxDec = 1e-6, n = 2, level = 5)
tree <- e2tree(mpg ~ ., training, D, ensemble, setting)
residuals(tree)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.