Skip to main content

Confusion matrix tool.

Further information:

Instalation

From source code:

python setup.py install

From pypi:

pip intall confumatrix

Usage

>>> from confumatrix import ConfuMatrix
>>> cm = ConfuMatrix(a=10, b=1, c=10, d=3)
>>> cm.accuracy()
0.5416666666666666
>>> cm.precision()
0.9090909090909091
>>> cm.recall()
0.5
>>> cm.specificity()
0.75
>>> cm.sensitivity()
0.5
>>> cm.f1()
0.6451612903225806
>>> print cm
=========================
Confusion Matrix:

    10  1
    10  3

Accuracy: 0.541666666667
Recall: 0.5
Precision: 0.909090909091
Specificity: 0.75
F-measure: 0.645161290323
=========================

binary_classification.py

Load a yaml file with results of a binary classfication and prints Confusion matrix for that results.

Input file format:

# Languages that can be detected
types: [en, es, pt, it, de]
umbral: 0.5
sample:
  - result:
      en: 0.1
      es: 0.2
      pt: 0.3
      it: 0.6666  #hit! ( 0.6666 > 0.5 )
      de: 0.3
    expected: de
  - result:
      en: 0.2
      es: 0.99 # hit
      pt: 0.98 # hit
      it: 0.4
      de: 0.3
    expected: es

Metadata

Release files for confumatrix 0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for confumatrix 0.1
File Size Uploaded Provenance Actions
confumatrix-0.1.tar.gz 3.7 kB Without provenance Details for confumatrix-0.1.tar.gz

Release files / confumatrix-0.1.tar.gz

Download URL confumatrix-0.1.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
df865043837479a2bf239412c9961c074588284e12e6a7b24061d8d081ffdc12
BLAKE2b-256 checksum
How to use checksums
e9be0c25ec31386a064e9d95b0a3150d5362921a47ada6635692a7c130f8b2ea
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for confumatrix 0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page