A simple python package to plot confusion matrices
Project description
Easy CM
A simple python package to plot confusion matrices.
Installation
foo@bar:~$ pip install easycm
Usage
You can simply call the function with predictions and true values from your classification problem.
from easycm import plot_confusion_matrix
import matplotlib.pyplot as plt
y_true = [False, True, True, False]
y_pred = [False, False, True, True]
plot_confusion_matrix(y_true, y_pred)
plt.show()
To include your confusion matrix in subplots, you can do the following
from easycm import plot_confusion_matrix
import matplotlib.pyplot as plt
y_true = [False, True, True, False]
y_pred = [False, False, True, True]
fig, axs = plt.subplots(1, 2)
plot_confusion_matrix(y_true, y_pred, ax=axs[0])
plt.show()
You can also customize the labels for the X and Y axis and the title.
from easycm import plot_confusion_matrix
import matplotlib.pyplot as plt
y_true = [False, True, True, False]
y_pred = [False, False, True, True]
plot_confusion_matrix(y_true, y_pred, title='Title', xlabel='X', ylabel='Y')
plt.show()
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
easycm-0.0.4.tar.gz
(2.9 kB
view details)
Built Distribution
File details
Details for the file easycm-0.0.4.tar.gz
.
File metadata
- Download URL: easycm-0.0.4.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 995ea24360d4e8ea3fbf7089b1fa25da2d20b227a57341ca03466c0ca4821418 |
|
MD5 | e64f26db6023055864ac777b4f5799a5 |
|
BLAKE2b-256 | fc6c5b1faa86ec9395e1fed52dc6efdf3e8cddfa9f81f360f5c8015669cf488a |
File details
Details for the file easycm-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: easycm-0.0.4-py3-none-any.whl
- Upload date:
- Size: 3.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.10.1 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.9.10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4a5fbd5f769d8026f4ed8d8232cc123372b95f548530904cac164cdc3423245 |
|
MD5 | 9ea01eb79d2bbb4d6e4cb3714cb76f13 |
|
BLAKE2b-256 | 33d0dc6ffb1c45ccb74b92d7af1acd9f7322954a28c60ab05b3c12b2dc042ff3 |