File: getOOBPreds.Rd

package info (click to toggle)
r-cran-mlr 2.19.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 8,264 kB
  • sloc: ansic: 65; sh: 13; makefile: 5
file content (39 lines) | stat: -rw-r--r-- 1,184 bytes parent folder | download
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{ \} }
}