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.0.tar.gz (5.3 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.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for classification_report_as_df-0.1.0.tar.gz
Algorithm Hash digest
SHA256 2a94809b52dca71cd66ff59afc2a82e0a0121a9b0e0c51b0b977047d32843a03
MD5 1ab59a02df64bb860375516be4b9bbe6
BLAKE2b-256 f040bd3d41232ac5cd34a861a7aa9226742a314b2a397de57daaad99bdae84a1

See more details on using hashes here.

Provenance

The following attestation bundles were made for classification_report_as_df-0.1.0.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.0-py3-none-any.whl.

File metadata

File hashes

Hashes for classification_report_as_df-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ec4ffb1996fe03452669917c968350cea4b12c6217b91ce11573318be08bb9e6
MD5 7e9896e33a764eb04b38c0d29fcd2c4d
BLAKE2b-256 beff950fb04df99e78990adcb6176a8fa1d87de74ead2060e5bf54a7110704f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for classification_report_as_df-0.1.0-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