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.2.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.2-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for classification_report_as_df-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5d19a2abdc2ff62b5e592a9208a21c78b50cb0c2723bda7a653da83b8b28d37f
MD5 b0025f9593a35ea75bebb6412c4c138a
BLAKE2b-256 2f3954b332df78a71a08f0974babf4ae2d81d8e92c08446aa6ccd4235bb3226f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for classification_report_as_df-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7aaaa957f5c7c1b383c5b9a8c6cabb3181fae854537dbf47a3900ea4261f1034
MD5 1b7fef9c7fff7f7a2514692fc7925385
BLAKE2b-256 daf6b4e096915e4304fcbf702f43f0abbe97352417415d2065054b684d3ac145

See more details on using hashes here.

Provenance

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