AI & Machine Learning calculator

ROC curve and AUC calculator

Compute Receiver Operating Characteristic (ROC) curve coordinates, Area Under Curve (AUC-ROC), Gini coefficient, and DeLong confidence intervals.

Run this test live in StatLab npm i @statlab/core

When to use it

Use for evaluating threshold-independent probability scoring classifiers.

Required Inputs

  • True binary labels (0/1)
  • Predicted probability scores

Mathematical Formula

AUC = ∫ TPR(t) d(FPR(t)) = P(Score_positive > Score_negative)

Reporting Cautions

  • AUC measures ranking quality; inspect PR-AUC (Precision-Recall AUC) under severe class imbalance.
  • DeLong test allows statistical comparison between two correlated ROC curves.

Code Snippets (Python, R, TypeScript)

Python (SciPy / Statsmodels)
from sklearn.metrics import roc_auc_score
auc = roc_auc_score(y_true, y_scores)
print(f"AUC={auc:.4f}")
R Language
library(pROC)
roc_obj <- roc(y_true, y_scores)
auc(roc_obj)
TypeScript (@statlab/core)
import { rocMetrics } from '@statlab/core';
const res = rocMetrics(yTrue, yScores);

Developer Use Cases & Production Integrations

  • Evaluating probability calibration and ranking performance of AI classification models.
  • Comparing model version AUC scores in VoxelAssurance release readiness sprints.

VoxelPulse Telemetry Control Plane

Continuous A/B testing, statistical telemetry analysis, and automated feedback loops for live backend services.

Explore VoxelPulse →

VoxelAssurance Release Readiness

Fixed-price AI release-readiness sprints, automated regression testing, and reliability statistical benchmarks.

Explore VoxelAssurance →

Related Statistical Test Calculators

Explore static calculators across the StatLab inference engine suite.