Generating reports on metrics for Machine Learning models
Project description
Metrics Report
MetricsReport is a Python package that generates classification and regression metrics report for machine learning models.
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file metricsreport-2025.7.23.tar.gz.
File metadata
- Download URL: metricsreport-2025.7.23.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.2 Linux/6.8.8-2-pve
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0bc5c06640b608b69a352e014b8f263aa570dea63a2365682d9de39f1a0066b0
|
|
| MD5 |
f1fb28b94dd138735b3deeb85631b264
|
|
| BLAKE2b-256 |
5f30455d307ac0a2bbc802fc97ee09b571e600a0c87734e7a68f3fee3cf0b177
|
File details
Details for the file metricsreport-2025.7.23-py3-none-any.whl.
File metadata
- Download URL: metricsreport-2025.7.23-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.3 CPython/3.12.2 Linux/6.8.8-2-pve
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4f5247b171f033bb6647b66fd7e36d2d6fedb985652554e04227e010d5e16495
|
|
| MD5 |
2ecc0b5508c102d71f3e4741d9e656b4
|
|
| BLAKE2b-256 |
735556501ebee023a9f6cbe29be88753b32ed315d2f1a6dfd4829d673e4b8911
|