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
|
\name{accuracy}
\alias{accuracy}
\title{Prediction Accuracy from Stability Assessment Results}
\description{
Function to compute the prediction accuracy from an object
of class \code{"stablelearner"} or \code{"stablelearnerList"} as a parallel
to the similarity values estimated by \code{\link{stability}} in each
iteration of the stability assessment procedure.
}
\usage{
accuracy(x, measure = "kappa", na.action = na.exclude,
applyfun = NULL, cores = NULL)
}
\arguments{
\item{x}{an object of class \code{"stablelearner"} or
\code{"stablelearnerList"}.}
\item{measure}{a character string (or a vector of character strings).
Name(s) of the measure(s) used to compute accuracy. Currently implemented
measures are \code{"diag"} = percentage of observations on the main diagonal
of a confusion matrix, \code{"kappa"} = \code{"diag"} corrected for agreement
by chance (default), \code{"rand"} = Rand index, and \code{"crand"} =
Rand index corrected for agreemend by chance
(see also \code{\link{classAgreement}}).}
\item{na.action}{a function which indicates what should happen to the predictions
of the results containing \code{NAs}. The default function is
\code{\link{na.exclude}}.}
\item{applyfun}{a \code{\link[base]{lapply}}-like function. The default is to use
\code{\link{lapply}} unless \code{cores} is specified in which case
\code{\link{mclapply}} is used (for multicore computations on platforms
that support these).}
\item{cores}{integer. The number of cores to use in multicore computations
using \code{\link{mclapply}} (see above).}
}
\details{
This function can be used to compute prediction accuracy after the stability was
estimated using \code{\link{stability}}.
}
\value{
A matrix of size \code{2*B} times length(\code{measure}) containing prediction
accuracy values of the learners trained during the stability assessment procedure.
}
\seealso{\code{\link{stability}}}
\examples{
\donttest{
library("partykit")
res <- ctree(Species ~ ., data = iris)
stab <- stability(res)
accuracy(stab)
}
}
\keyword{resampling}
\keyword{similarity}
|