% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/methods_e2tree.R
\name{residuals.e2tree}
\alias{residuals.e2tree}
\title{Extract Residuals from an E2Tree Model}
\usage{
\method{residuals}{e2tree}(object, ...)
}
\arguments{
\item{object}{An e2tree object.}

\item{...}{Additional arguments (ignored).}
}
\value{
A numeric vector of residuals.
}
\description{
Returns the residuals (observed minus fitted) for regression E2Tree models.
Not available for classification models.
}
\examples{
\donttest{
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)
}

}
