sklearn-style classification report as a pandas DataFrame
Project description
classification-report-as-df
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file classification_report_as_df-0.1.2.tar.gz.
File metadata
- Download URL: classification_report_as_df-0.1.2.tar.gz
- Upload date:
- Size: 5.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5d19a2abdc2ff62b5e592a9208a21c78b50cb0c2723bda7a653da83b8b28d37f
|
|
| MD5 |
b0025f9593a35ea75bebb6412c4c138a
|
|
| BLAKE2b-256 |
2f3954b332df78a71a08f0974babf4ae2d81d8e92c08446aa6ccd4235bb3226f
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
classification_report_as_df-0.1.2.tar.gz -
Subject digest:
5d19a2abdc2ff62b5e592a9208a21c78b50cb0c2723bda7a653da83b8b28d37f - Sigstore transparency entry: 771897505
- Sigstore integration time:
-
Permalink:
Michal58/classification-report-as-df@ef9e37b2da456b35d95ef46522b33d3152e21c5d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Michal58
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
manual-release.yml@ef9e37b2da456b35d95ef46522b33d3152e21c5d -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file classification_report_as_df-0.1.2-py3-none-any.whl.
File metadata
- Download URL: classification_report_as_df-0.1.2-py3-none-any.whl
- Upload date:
- Size: 5.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7aaaa957f5c7c1b383c5b9a8c6cabb3181fae854537dbf47a3900ea4261f1034
|
|
| MD5 |
1b7fef9c7fff7f7a2514692fc7925385
|
|
| BLAKE2b-256 |
daf6b4e096915e4304fcbf702f43f0abbe97352417415d2065054b684d3ac145
|
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
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
classification_report_as_df-0.1.2-py3-none-any.whl -
Subject digest:
7aaaa957f5c7c1b383c5b9a8c6cabb3181fae854537dbf47a3900ea4261f1034 - Sigstore transparency entry: 771897514
- Sigstore integration time:
-
Permalink:
Michal58/classification-report-as-df@ef9e37b2da456b35d95ef46522b33d3152e21c5d -
Branch / Tag:
refs/heads/main - Owner: https://github.com/Michal58
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
manual-release.yml@ef9e37b2da456b35d95ef46522b33d3152e21c5d -
Trigger Event:
workflow_dispatch
-
Statement type: