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 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 2023.3.7
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| metricsreport-2023.3.7.tar.gz | 6.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| metricsreport-2023.3.7-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 14.4 kB
Release files / metricsreport-2023.3.7.tar.gz
| Download URL | metricsreport-2023.3.7.tar.gz |
|---|---|
| Size | 6.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
558aea9085e14edd2f5204315dc80da882bfe7e79fca5fb2b035edb15895701e
|
|
BLAKE2b-256 checksum How to use checksums |
26dc16bc220e194abe0436b5f93f1d870686986ccca1a0acbf0128241e2f912e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.10.9 Darwin/21.6.0
|
Release files / metricsreport-2023.3.7-py3-none-any.whl
| Download URL | metricsreport-2023.3.7-py3-none-any.whl |
|---|---|
| Size | 7.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f59e14f1a177707b4b308a6028a0bf42a13dd6a50d12b55be65e17576f0c705f
|
|
BLAKE2b-256 checksum How to use checksums |
aed572f67d0f43127b1278a5afe5241481a5b8314e1ccc476710d702495ea9f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.10.9 Darwin/21.6.0
|