https://github.com/berndbischl/mlr
Raw File
Tip revision: 2fd339b359e367de5c26888c5b4bbe05fe5d41ef authored by pfistfl on 11 April 2018, 15:19:41 UTC
Add basic tests
Tip revision: 2fd339b
plotCalibration.Rd
% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/generateCalibration.R
\name{plotCalibration}
\alias{plotCalibration}
\title{Plot calibration data using ggplot2.}
\usage{
plotCalibration(obj, smooth = FALSE, reference = TRUE, rag = TRUE,
  facet.wrap.nrow = NULL, facet.wrap.ncol = NULL)
}
\arguments{
\item{obj}{(\link{CalibrationData})\cr
Result of \link{generateCalibrationData}.}

\item{smooth}{(\code{logical(1)})\cr
Whether to use a loess smoother.
Default is \code{FALSE}.}

\item{reference}{(\code{logical(1)})\cr
Whether to plot a reference line showing perfect calibration.
Default is \code{TRUE}.}

\item{rag}{(\code{logical(1)})\cr
Whether to include a rag plot which shows a rug plot on the top which pertains to
positive cases and on the bottom which pertains to negative cases.
Default is \code{TRUE}.}

\item{facet.wrap.nrow, facet.wrap.ncol}{([integer])\cr
Number of rows and columns for facetting. Default for both is `NULL`.
In this case ggplot's `facet_wrap` will choose the layout itself.}
}
\value{
ggplot2 plot object.
}
\description{
Plots calibration data from \link{generateCalibrationData}.
}
\examples{
\dontrun{
lrns = list(makeLearner("classif.rpart", predict.type = "prob"),
            makeLearner("classif.nnet", predict.type = "prob"))
fit = lapply(lrns, train, task = iris.task)
pred = lapply(fit, predict, task = iris.task)
names(pred) = c("rpart", "nnet")
out = generateCalibrationData(pred, groups = 3)
plotCalibration(out)

fit = lapply(lrns, train, task = sonar.task)
pred = lapply(fit, predict, task = sonar.task)
names(pred) = c("rpart", "lda")
out = generateCalibrationData(pred)
plotCalibration(out)
}
}
\seealso{
Other plot: \code{\link{plotBMRBoxplots}},
  \code{\link{plotBMRRanksAsBarChart}},
  \code{\link{plotBMRSummary}},
  \code{\link{plotCritDifferences}},
  \code{\link{plotFilterValuesGGVIS}},
  \code{\link{plotLearningCurveGGVIS}},
  \code{\link{plotLearningCurve}},
  \code{\link{plotPartialDependenceGGVIS}},
  \code{\link{plotPartialDependence}},
  \code{\link{plotROCCurves}}, \code{\link{plotResiduals}},
  \code{\link{plotThreshVsPerfGGVIS}},
  \code{\link{plotThreshVsPerf}}

Other calibration: \code{\link{generateCalibrationData}}
}
back to top