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) 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_all_count_metrics(): Generates a count metrics 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_class_hist(): Generates a class histogram 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.5.15

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.5.15
File Size Uploaded Provenance Actions
metricsreport-2024.5.15.tar.gz 14.0 kB Without provenance Details for metricsreport-2024.5.15.tar.gz

Built distribution (wheel)

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

Total release size: 28.3 kB

Release files / metricsreport-2024.5.15.tar.gz

Download URL metricsreport-2024.5.15.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
077f7295a23efee1ce147213b4af7a0e040a1ecaeeae57c006207fd2b5a6eade
BLAKE2b-256 checksum
How to use checksums
76a6bb2eaacd67ad28f93edec25dab983d4e39cbd294851f1e5bf78788fdf8f2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.0 Linux/6.5.13-3-pve

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

Download URL metricsreport-2024.5.15-py3-none-any.whl
Size 14.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
04b00fb2edb17dd3e2edffe87ea32c23f5bb30c3e9739c3e96ff564feaf7cde6
BLAKE2b-256 checksum
How to use checksums
5773f4801ce7645a2dfcbdfdd2e8d3ddd0ff5fca237ae643a95c2d4727694ae7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.8.2 CPython/3.10.0 Linux/6.5.13-3-pve

Security for metricsreport 2024.5.15

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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