Learn R Programming

cutpointr (version 1.2.0)

Determine and Evaluate Optimal Cutpoints in Binary Classification Tasks

Description

Estimate cutpoints that optimize a specified metric in binary classification tasks and validate performance using bootstrapping. Some methods for more robust cutpoint estimation are supported, e.g. a parametric method assuming normal distributions, bootstrapped cutpoints, and smoothing of the metric values per cutpoint using Generalized Additive Models. Various plotting functions are included. For an overview of the package see Thiele and Hirschfeld (2021) .

Copy Link

Version

Install

install.packages('cutpointr')

Monthly Downloads

1,506

Version

1.2.0

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Christian Thiele

Last Published

December 10th, 2024

Functions in cutpointr (1.2.0)

boot_ci

Calculate bootstrap confidence intervals from a cutpointr object
auc

Calculate AUC from a roc_cutpointr or cutpointr object
cutpointr_

The standard evaluation version of cutpointr (deprecated)
cutpoint

Extract the cutpoints from a ROC curve generated by cutpointr
metric_constrain

Metrics that are constrained by another metric
abs_d_ppv_npv

Calculate the absolute difference of positive and negative predictive value
maximize_loess_metric

Optimize a metric function in binary classification after LOESS smoothing
abs_d_sens_spec

Calculate the absolute difference of sensitivity and specificity
maximize_metric

Optimize a metric function in binary classification
misclassification_cost

Calculate the misclassification cost
maximize_boot_metric

Optimize a metric function in binary classification after bootstrapping
maximize_gam_metric

Optimize a metric function in binary classification after smoothing via generalized additive models
oc_youden_normal

Determine an optimal cutpoint for the Youden-Index assuming normal distributions
odds_ratio

Calculate the odds ratio
oc_median

Use the sample median as cutpoint
oc_youden_kernel

Determine an optimal cutpoint maximizing the Youden-Index based on kernel smoothed densities
oc_manual

Set a manual cutpoint for use with cutpointr
oc_mean

Use the sample mean as cutpoint
plot_metric

Plot a metric over all possible cutoffs from a cutpointr object
plot_metric_boot

Plot the bootstrapped metric distribution from a cutpointr object
plot_cut_boot

Plot the bootstrapped distribution of optimal cutpoints from a cutpointr object
plot_cutpointr

General purpose plotting function for cutpointr or roc_cutpointr objects
multi_cutpointr

Calculate optimal cutpoints and further statistics for multiple predictors
false_omission_rate

Calculate the false omission and false discovery rate
npv

Calculate the negative predictive value
plot_precision_recall

Precision recall plot from a cutpointr object
ppv

Calculate the positive predictive value
plr

Calculate the positive or negative likelihood ratio
plot_roc

Plot ROC curve from a cutpointr or roc_cutpointr object
predict.cutpointr

Predict using a cutpointr object
precision

Calculate precision
prod_sens_spec

Calculate the product of sensitivity and specificity
plot.multi_cutpointr

Plotting multi_cutpointr objects is currently not supported
sum_ppv_npv

Calculate the sum of positive and negative predictive value
prostate_nodal

Nodal involvement and acid phosphatase levels in 53 prostate cancer patients
plot.roc_cutpointr

Plot ROC curve from a cutpointr or roc_cutpointr object
prod_ppv_npv

Calculate the product of positive and negative predictive value
recall

Calculate recall
roc01

Calculate the distance between points on the ROC curve and (0,1)
sum_sens_spec

Calculate the sum of sensitivity and specificity
plot.cutpointr

Plot cutpointr objects
p_chisquared

Calculate the p-value of a chi-squared test
specificity

Calculate specificity
cutpointr

Determine and evaluate optimal cutpoints
suicide

Suicide attempts and DSI sum scores of 532 subjects
risk_ratio

Calculate the risk ratio (relative risk)
sensitivity

Calculate sensitivity
roc

Calculate a ROC curve
user_span_cutpointr

Calculate bandwidth for LOESS smoothing of metric functions by rule of thumb
tpr

Calculate true / false positive / negative rate
plot_sensitivity_specificity

Sensitivity and specificity plot from a cutpointr object
youden

Calculate the Youden-Index
print.cutpointr

Print cutpointr objects
plot_x

Plot the distribution of the independent variable per class from a cutpointr object
print.multi_cutpointr

Print multi_cutpointr objects
total_utility

Calculate the total utility
tp

Extract number true / false positives / negatives
cohens_kappa

Calculate Cohen's Kappa
boot_test

Test for equivalence of a metric
Jaccard

Calculate the Jaccard Index
F1_score

Calculate the F1-score
add_metric

Add metrics to a cutpointr or roc_cutpointr object
accuracy

Calculate accuracy