Skip to main content

sklearn-style classification report as a pandas DataFrame

Project description

classification-report-as-df

License: MIT Tests

Small, single-module utility that converts scikit-learn's text-style classification report into an easy-to-manipulate pandas DataFrame. For easier display in IPython environments (e.g. Jupyter), the report can also be returned as a pandas Styler.

Example usage

General scenario:

import numpy as np
from classification_report_as_df import classification_report_as_df

y_true = np.array([0, 1, 0, 1, 1])
y_pred = np.array([0, 0, 0, 1, 1])

df = classification_report_as_df(
    y_true=y_true,
    y_pred=y_pred
)

Jupyter notebook pretty-rendering scenario:

import numpy as np
from classification_report_as_df import classification_report_as_df

y_true = np.array([0, 1, 0, 1, 1])
y_pred = np.array([0, 0, 0, 1, 1])

classification_report_as_df(
    y_true=y_true,
    y_pred=y_pred,
    decimal_places_for_display=2
)

Development

Clone repository:

git clone https://github.com/Michal58/classification-report-as-df
cd classification-report-as-df

Install dependencies:

pip install classification_report_as_df[dev]

or (from root directory):

pip install -e '.[dev]'

You can run tests calling (from root directory):

pytest

License

This project is licensed under the MIT License — see the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

classification_report_as_df-0.1.1.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

classification_report_as_df-0.1.1-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file classification_report_as_df-0.1.1.tar.gz.

File metadata

File hashes

Hashes for classification_report_as_df-0.1.1.tar.gz
Algorithm Hash digest
SHA256 f343c18586fcb7a22f2d84a86b7026db14cebbbfcafc1a45e65ca7938bd5927f
MD5 5e5b09da16bc4b1a1039050afdc94324
BLAKE2b-256 6121afea2b2cbb768a702d419ed199be0099f6c9df2cb2962d4c76bbe2c63b9e

See more details on using hashes here.

Provenance

The following attestation bundles were made for classification_report_as_df-0.1.1.tar.gz:

Publisher: manual-release.yml on Michal58/classification-report-as-df

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file classification_report_as_df-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for classification_report_as_df-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 2c327f7172ef45526bedaca4d89d79ee6c7a5900019824355f479357a7515dc9
MD5 9cf4350474cceffea12596b20e0d71c0
BLAKE2b-256 1dea26f4ae43d77e43f3790493043199f06f4dce63c4cf1ecebc5377e07a0dd7

See more details on using hashes here.

Provenance

The following attestation bundles were made for classification_report_as_df-0.1.1-py3-none-any.whl:

Publisher: manual-release.yml on Michal58/classification-report-as-df

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page