Last chance! 50% off unlimited learning
Sale ends in
Calculate curves for the analysis of tradeoffs between metrics for assessing performance in classifying binary outcomes over the range of possible cutoff probabilities. Available curves include receiver operating characteristic (ROC) and precision recall.
performance_curve(x, ...)# S3 method for default
performance_curve(
x,
y,
weights = NULL,
metrics = c(MachineShop::tpr, MachineShop::fpr),
na.rm = TRUE,
...
)
# S3 method for Resample
performance_curve(
x,
metrics = c(MachineShop::tpr, MachineShop::fpr),
na.rm = TRUE,
...
)
PerformanceCurve
class object that inherits from
data.frame
.
observed responses or resample result containing observed and predicted responses.
arguments passed to other methods.
predicted responses if not contained in x
.
numeric vector of non-negative
case weights for the observed x
responses
[default: equal weights].
list of two performance metrics for the analysis
[default: ROC metrics]. Precision recall curves can be obtained with
c(precision, recall)
.
logical indicating whether to remove observed or predicted
responses that are NA
when calculating metrics.
# \donttest{
## Requires prior installation of suggested package gbm to run
data(Pima.tr, package = "MASS")
res <- resample(type ~ ., data = Pima.tr, model = GBMModel)
## ROC curve
roc <- performance_curve(res)
plot(roc)
auc(roc)
# }
Run the code above in your browser using DataLab