Skip to main content

Metrics Report

PyPI - Python Version PyPI Telegram License


MetricsReport is a Python package that generates classification and regression metrics report for machine learning models.

sample

Features

  • AutoDetect the type of task
  • Save report in .html and .md format
  • Has several plotting functions

Installation

You can install MetricsReport using pip:

pip install metricsreport

Usage

from metricsreport import MetricsReport  

# sample classification data 
y_true = [1, 0, 0, 1, 0, 1, 0, 1] 
y_pred = [0.8, 0.3, 0.1, 0.9, 0.4, 0.7, 0.2, 0.6]  

# generate report 
report = MetricsReport(y_true, y_pred, threshold=0.5)  

# print all metrics 
print(report.metrics)  

# plot ROC curve 
report.plot_roc_curve()

# saved MetricsReport (html and .md) in folder: report_metrics
report.save_report()

More examples in the folder ./examples:

Constructor

MetricsReport(y_true, y_pred, threshold: float = 0.5)
  • y_true : list
    • A list of true target values.
  • y_pred : list
    • A list of predicted target values.
  • threshold : float
    • Threshold for generating binary classification metrics. Default is 0.5.

Plots

following methods can be used to generate plots:

  • plot_roc_curve(): Generates a ROC curve plot.
  • plot_precision_recall_curve(): Generates a precision-recall curve plot.
  • plot_confusion_matrix(): Generates a confusion matrix plot.
  • plot_class_distribution(): Generates a class distribution plot.
  • plot_calibration_curve(): Generates a calibration curve plot.
  • plot_lift_curve(): Generates a lift curve plot.
  • plot_cumulative_gain(): Generates a cumulative gain curve plot.

Dependencies

  • numpy
  • pandas
  • matplotlib
  • scikit-learn
  • scikit-plot

License

This project is licensed under the MIT License.

Metadata

Release files for metricsreport 2024.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for metricsreport 2024.1.1
File Size Uploaded
metricsreport-2024.1.1.tar.gz 8.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for metricsreport 2024.1.1
File Interpreter ABI Platform
metricsreport-2024.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 17.6 kB

Release files / metricsreport-2024.1.1.tar.gz

Download URL metricsreport-2024.1.1.tar.gz
Size 8.6 kB
Tags Source
SHA-256 checksum
How to use checksums
19d1e66efafa29f627553b17a82063fcbcd81f727760d6be966fbdd9ab27e0ac
BLAKE2b-256 checksum
How to use checksums
0088d2f0857afc50d1aa0592b640934f6543c9c0474b2a3894a34a21d3e7c3ae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-79-generic

Release files / metricsreport-2024.1.1-py3-none-any.whl

Download URL metricsreport-2024.1.1-py3-none-any.whl
Size 9.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8b0695f4905ecc1808000e1d2011f8a4a1fe06f4416a9fac7e048a4f563df57a
BLAKE2b-256 checksum
How to use checksums
5d33b8eeb60e1195a76f402a4bd2964f364db175647e668501c0ac665fb22fee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.5.1 CPython/3.10.12 Linux/5.15.0-79-generic
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page