1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/getOOBPreds.R
\name{getOOBPreds}
\alias{getOOBPreds}
\title{Extracts out-of-bag predictions from trained models.}
\usage{
getOOBPreds(model, task)
}
\arguments{
\item{model}{(\link{WrappedModel})\cr
The model.}
\item{task}{(\link{Task})\cr
The task.}
}
\value{
(\link{Prediction}).
}
\description{
Learners like \code{randomForest} produce out-of-bag predictions.
\code{getOOBPreds} extracts this information from trained models and builds a
prediction object as provided by predict (with prediction time set to NA).
In the classification case:
What is stored exactly in the (\link{Prediction}) object depends
on the \code{predict.type} setting of the \link{Learner}.
You can call \code{listLearners(properties = "oobpreds")} to get a list of learners
which provide this.
}
\examples{
\dontshow{ if (requireNamespace("ranger")) \{ }
training.set = sample(1:150, 50)
lrn = makeLearner("classif.ranger", predict.type = "prob", predict.threshold = 0.6)
mod = train(lrn, sonar.task, subset = training.set)
oob = getOOBPreds(mod, sonar.task)
oob
performance(oob, measures = list(auc, mmce))
\dontshow{ \} }
}
|