View source: R/performance_curve.R
performance_curve | R Documentation |
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, ...)
## Default S3 method:
performance_curve(
x,
y,
weights = NULL,
metrics = c(MachineShop::tpr, MachineShop::fpr),
na.rm = TRUE,
...
)
## S3 method for class 'Resample'
performance_curve(
x,
metrics = c(MachineShop::tpr, MachineShop::fpr),
na.rm = TRUE,
...
)
x |
observed responses or resample result containing observed and predicted responses. |
... |
arguments passed to other methods. |
y |
predicted responses if not contained in |
weights |
numeric vector of non-negative
case weights for the observed |
metrics |
list of two performance metrics for the analysis
[default: ROC metrics]. Precision recall curves can be obtained with
|
na.rm |
logical indicating whether to remove observed or predicted
responses that are |
PerformanceCurve
class object that inherits from
data.frame
.
auc
, c
, plot
,
summary
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.