Metadata-Version: 2.1
Name: metricsreport
Version: 2024.1.2
Summary: Generating reports on metrics for Machine Learning models
Home-page: https://github.com/Alex-Lekov/metricsreport
Author: Alex Lekov
Author-email: 11148364-AlexLekov@users.noreply.gitlab.com
Requires-Python: >=3.8,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: markdownify (>=0.11.6,<0.12.0)
Requires-Dist: matplotlib (>=3.7.1,<4.0.0)
Requires-Dist: plot-metric (>=0.0.6,<0.0.7)
Requires-Dist: scikit-learn (>=1.3.0,<2.0.0)
Requires-Dist: scikit-plot (>=0.3.7,<0.4.0)
Project-URL: Repository, https://github.com/Alex-Lekov/metricsreport
Description-Content-Type: text/markdown

# Metrics Report

![PyPI - Python Version](https://img.shields.io/pypi/pyversions/metricsreport) 
![PyPI](https://img.shields.io/pypi/v/metricsreport) 
[![Telegram](https://img.shields.io/badge/chat-on%20Telegram-2ba2d9.svg)](https://t.me/automlalex) 
[![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE) 

-------------

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


<img width=600 src="./exemples/metricsrepor_html.gif" alt="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:

```bash
pip install metricsreport
```

## Usage

```python
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

```python
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.
