Skip to main content

Confusion matrix tool for binary classification.

Project description

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

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

confumatrix-0.1.tar.gz (3.7 kB view details)

Uploaded Source

File details

Details for the file confumatrix-0.1.tar.gz.

File metadata

  • Download URL: confumatrix-0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for confumatrix-0.1.tar.gz
Algorithm Hash digest
SHA256 df865043837479a2bf239412c9961c074588284e12e6a7b24061d8d081ffdc12
MD5 17b5d887948a879ef724a858cfa965ed
BLAKE2b-256 e9be0c25ec31386a064e9d95b0a3150d5362921a47ada6635692a7c130f8b2ea

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page