Skip to main content

A package for generating comprehensive binary classification reports with visualizations and confidence intervals

Project description

Tests Deploy

Omnibin

A Python package for generating comprehensive binary classification reports with visualizations and confidence intervals.

Try it Online

You can try Omnibin directly in your browser through our Hugging Face Space.

Installation

pip install omnibin

Usage

import pandas as pd
from omnibin import generate_binary_classification_report, ColorScheme

# Load your data
data = pd.read_csv("data/scores.csv")
y_true = data['y_true'].values
y_scores = data['y_pred'].values

# Generate comprehensive classification report
report_path = generate_binary_classification_report(
    y_true=y_true,                    # Array of true binary labels (0 or 1)
    y_scores=y_scores,                # Array of predicted probabilities or scores
    output_path="classification_report.pdf",  # Path to save the PDF report
    n_bootstrap=1000,                 # Number of bootstrap iterations for confidence intervals
    random_seed=42,                   # Random seed for reproducibility
    dpi=300,                          # DPI for plot resolution
    color_scheme=ColorScheme.DEFAULT  # Color scheme for plots (DEFAULT, MONOCHROME, or VIBRANT)
)

Input Format

The input data should be provided as:

  • y_true: Array of true binary labels (0 or 1)
  • y_pred: Array of predicted probabilities or scores

Features

  • Generates a comprehensive PDF report with:
    • ROC curve with confidence bands
    • Precision-Recall curve with confidence bands
    • Metrics vs. threshold plots
    • Confusion matrix at optimal threshold
    • Calibration plot
    • Summary table with confidence intervals
  • Calculates optimal threshold using Youden's J statistic
  • Provides confidence intervals using bootstrapping
  • Supports both probability and score-based predictions

Metrics Included

  • Accuracy
  • Sensitivity (Recall)
  • Specificity
  • Positive Predictive Value (Precision)
  • Matthews Correlation Coefficient
  • F1 Score
  • AUC-ROC
  • AUC-PR

All metrics include 95% confidence intervals calculated through bootstrapping.

Output

The package generates a PDF report containing:

  1. ROC and Precision-Recall curves with confidence bands
  2. Metrics plotted across different thresholds
  3. Confusion matrix at the optimal threshold
  4. Calibration plot
  5. Summary table with all metrics and their confidence intervals

Example

Here are examples of the visualizations generated by Omnibin:

ROC and Precision-Recall Curves

ROC and PR Curves

Metrics vs Threshold

Confusion Matrix

Calibration Plot

Prediction Distribution

Metrics Summary

Metrics Summary

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

omnibin-0.1.7.tar.gz (148.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

omnibin-0.1.7-py3-none-any.whl (7.5 kB view details)

Uploaded Python 3

File details

Details for the file omnibin-0.1.7.tar.gz.

File metadata

  • Download URL: omnibin-0.1.7.tar.gz
  • Upload date:
  • Size: 148.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for omnibin-0.1.7.tar.gz
Algorithm Hash digest
SHA256 b006bb9c42a93fe58b0f5bb76667830693d0a6e00a254198f1d595284cddfa62
MD5 a070002f9288709182909bf3812fccc7
BLAKE2b-256 c17027722d033bc84825a08ef35b34ac4fb064b4219ee834cc6c85e68300f120

See more details on using hashes here.

File details

Details for the file omnibin-0.1.7-py3-none-any.whl.

File metadata

  • Download URL: omnibin-0.1.7-py3-none-any.whl
  • Upload date:
  • Size: 7.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.11.9

File hashes

Hashes for omnibin-0.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 91c49c6254ddcae9acbb8c8d9142d9f879789eff74e1298956b0720eef271e84
MD5 55772953049e878021086768bb1670c8
BLAKE2b-256 740f3f4a713de1a644d41247ffc3b74fd2b08c0980f154b36a502944cae4936d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page