Precision-Recall Curve Calculator

Analyze classifier performance across thresholds, compare models, inspect weighted confusion matrices, find optimal operating points, and export complete precision-recall reports with interactive charts easily.

Calculator Results

Precision-Recall Curves

Recall appears on the horizontal axis. Precision appears on the vertical axis. Hover over points to inspect thresholds.

Selected Operating Point

Confusion Matrix

Model Comparison

RankModelPR AUCAverage PrecisionUnweighted APLift vs BaselineBest ThresholdPrecisionRecallF-score
Threshold TPFPTNFN PrecisionRecallF-score AccuracySpecificity

Data and Calculation Options

Use commas, spaces, semicolons, or new lines.
Leave blank to assign weight 1 to every observation.

Prediction Models

Optimal Threshold Rules

0.5 favors precision. 1 balances both. 2 favors recall.

CSV Import

Hold Ctrl or Command to select several model columns.

Single-Threshold Confusion Matrix Mode

Use this optional mode when only TP, FP, TN, and FN are available.

Formula Used

Precision = TP / (TP + FP)
Recall = TP / (TP + FN)
Fβ = (1 + β²) × Precision × Recall / (β² × Precision + Recall)
Specificity = TN / (TN + FP)
Accuracy = (TP + TN) / (TP + FP + TN + FN)
PR AUC = area under the Precision-Recall curve
Average Precision = Σ (Recallᵢ − Recallᵢ₋₁) × Precisionᵢ

How to Use

  1. Enter actual labels and one prediction-score list.
  2. Add more models when comparative analysis is required.
  3. Optionally enter sample weights or import CSV columns.
  4. Select threshold generation and optimization settings.
  5. Click calculate to create curves and detailed tables.
  6. Inspect the selected threshold and confusion matrix.
  7. Export results as CSV, PDF, PNG, or copied text.

Example Data

ObservationActual LabelModel A ScoreModel B ScoreWeight
110.950.881
200.820.611
310.780.832
400.430.551
510.670.721

Interpretation Guide

Precision measures how many positive predictions are correct. Recall measures how many actual positives are detected. Their balance depends strongly on the selected threshold.

A Precision-Recall curve is especially useful for imbalanced datasets. Its baseline equals the positive-class prevalence. Curves above that baseline indicate useful ranking performance.

Average Precision summarizes step-wise precision across recall gains. PR AUC uses numerical integration between curve points. The two values can differ slightly.

Frequently Asked Questions

What is a Precision-Recall curve?

It plots precision against recall across decision thresholds.

Why use it for imbalanced data?

It focuses directly on positive-class prediction quality.

What is the no-skill baseline?

It equals the weighted positive prevalence in the dataset.

What does Average Precision measure?

It summarizes precision over successive increases in recall.

How does beta affect F-score?

Lower beta favors precision, while higher beta favors recall.

Can prediction scores exceed one?

Yes, when unrestricted validation is selected for decision scores.

Can I compare several models?

Yes. Add score lists or choose multiple CSV columns.

Are sample weights supported?

Yes. Weighted confusion counts and metrics are calculated.

How is the optimal threshold chosen?

It follows your selected F-score, constraint, cost, or weighted rule.

Results are ready above the form.

Related Calculators

Confusion Matrix CalculatorClassification Accuracy CalculatorRecall CalculatorSpecificity CalculatorSensitivity CalculatorFalse Positive Rate CalculatorFalse Negative Rate CalculatorMatthews Correlation Coefficient CalculatorBalanced Accuracy CalculatorLog Loss Calculator

Important Note: All the Calculators listed in this site are for educational purpose only and we do not guarentee the accuracy of results. Please do consult with other sources as well.