A Python package for estimating the optimal cut-point of a predictor variable (feature) for a binary classification task. It is loosely inspired by cutpointr, an optimal cut-point calculation package for R.
Main usage:
- Optimal cut-point estimation
- Stability analysis of the estimated cut-points through bootstrapping
- Receiver-operating characteristic curve (ROC) analysis
pip install cutpointpy
cutpointpy.core: contains the main class (CutpointCalculator) with functionsfind()andbootstrap()respectively for optimal cut-point estimation and stability analysis/validation through bootstrapping.cutpointpy.utils: contains ancillary functions including methods for computing performance parameters on binary classification tasks (e.g. confusion matrices, accuracy, sensitivity, specificity and AUC)
We recommend the following marimo notebooks to get started with cutpointpy.
- Optimal cut-point estimation without bootstrapping
- Optimal cut-point estimation with bootstrapping
- Baratloo, A., Hosseini, M., Negida, A., El Ashal, G. Part 1: simple definition and calculation of accuracy, sensitivity and specificity (2015) Emergency 3(2):48-49
- Hassanzad M., Hajian-Tilaki K. Methods of determining optimal cut-point of diagnostic biomarkers with application of clinical data in ROC analysis: an update review (2024) BMC Medical Research Methodology, 24(1), art. no. 84