File: plotROCCurves.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 (77 lines) | stat: -rw-r--r-- 2,104 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generateThreshVsPerf.R
\name{plotROCCurves}
\alias{plotROCCurves}
\title{Plots a ROC curve using ggplot2.}
\usage{
plotROCCurves(
  obj,
  measures,
  diagonal = TRUE,
  pretty.names = TRUE,
  facet.learner = FALSE
)
}
\arguments{
\item{obj}{(\link{ThreshVsPerfData})\cr
Result of \link{generateThreshVsPerfData}.}

\item{measures}{([list(2)` of \link{Measure})\cr
Default is the first 2 measures passed to \link{generateThreshVsPerfData}.}

\item{diagonal}{(\code{logical(1)})\cr
Whether to plot a dashed diagonal line.
Default is \code{TRUE}.}

\item{pretty.names}{(\code{logical(1)})\cr
Whether to use the \link{Measure} name instead of the id in the plot.
Default is \code{TRUE}.}

\item{facet.learner}{(\code{logical(1)})\cr
Weather to use facetting or different colors to compare multiple learners.
Default is \code{FALSE}.}
}
\value{
ggplot2 plot object.
}
\description{
Plots a ROC curve from predictions.
}
\examples{
\dontshow{ if (requireNamespace("rpart")) \{ }
\donttest{
lrn = makeLearner("classif.rpart", predict.type = "prob")
fit = train(lrn, sonar.task)
pred = predict(fit, task = sonar.task)
roc = generateThreshVsPerfData(pred, list(fpr, tpr))
plotROCCurves(roc)

r = bootstrapB632plus(lrn, sonar.task, iters = 3)
roc_r = generateThreshVsPerfData(r, list(fpr, tpr), aggregate = FALSE)
plotROCCurves(roc_r)

r2 = crossval(lrn, sonar.task, iters = 3)
roc_l = generateThreshVsPerfData(list(boot = r, cv = r2), list(fpr, tpr), aggregate = FALSE)
plotROCCurves(roc_l)
}
\dontshow{ \} }
}
\seealso{
Other plot: 
\code{\link{createSpatialResamplingPlots}()},
\code{\link{plotBMRBoxplots}()},
\code{\link{plotBMRRanksAsBarChart}()},
\code{\link{plotBMRSummary}()},
\code{\link{plotCalibration}()},
\code{\link{plotCritDifferences}()},
\code{\link{plotLearningCurve}()},
\code{\link{plotPartialDependence}()},
\code{\link{plotResiduals}()},
\code{\link{plotThreshVsPerf}()}

Other thresh_vs_perf: 
\code{\link{generateThreshVsPerfData}()},
\code{\link{plotThreshVsPerf}()}
}
\concept{plot}
\concept{thresh_vs_perf}