PyCM

github.com/sepandhaghighi/pycm Developer Tools Open-source projectOpen source

PyCM provides a Python library for working with multiclass confusion matrices.

github.com/sepandhaghighi/pycm
PyCM homepage screenshot

About PyCM

PyCM is a Python library for working with multi-class confusion matrices, which are used to evaluate classification models. It can build a matrix from lists of actual and predicted labels, or from a matrix entered directly as a nested dictionary of counts. It prints raw and normalized matrices and reports overall and per-class statistics, including accuracy, F1, false positive rate, Kappa, and AUC. The source describes it as aimed mainly at data scientists who need a broad set of metrics for predictive models.

Plotting requires Matplotlib (3.0.0 or later) or Seaborn (0.9.1 or later). The project provides MATLAB examples, but using it from MATLAB requires a separate Python 3 installation. Support for older Python versions has ended: the source lists PyCM 4.3 as the last version for Python 3.6, PyCM 3.9 for Python 3.5, and PyCM 2.4 for Python 2.7 and 3.4.

Key features

  • Builds a multi-class confusion matrix from actual and predicted label vectors
  • Builds a confusion matrix directly from a nested dictionary of counts
  • Prints raw and normalized confusion matrices
  • Reports overall statistics such as overall accuracy, Kappa, and macro-averaged F1
  • Reports per-class statistics such as precision, recall, false negatives, and AUC
  • Includes MATLAB examples for use from MATLAB with Python installed
Best for: Data scientists who need a broad set of evaluation metrics for classification models.
Good for
  • Covers a wide range of class-level and overall evaluation statistics, as shown in its example output
  • Can be installed with pip, conda, or from source
  • Open source
Watch out for
  • Plotting requires Matplotlib or Seaborn to be installed separately
  • Recent releases no longer support older Python versions, such as Python 3.6 and earlier
  • Using it from MATLAB requires a separate Python 3 installation and interpreter configuration

PyCM at a glance

Type
Open-source project
Pricing
Not confirmed. Check the site
Open source
Yes · Source code
Language
English
Last checked
Oct 6, 2026 · Online when checked
Listed
Oct 5, 2026

PyCM alternatives

Tools and sites you could use instead, ranked by how closely they match.

All 24 alternatives

Popular in Developer Tools

Well-known listings from the same topic.

All 423

PyCM FAQ

How do I install PyCM with pip or conda?
The source shows pip install pycm==4.6 and conda install -c sepandhaghighi pycm. It also lists installing from source with pip install .
Which Python versions are supported?
The source does not give a full current list. It states that PyCM 4.3 is the last version to support Python 3.6, PyCM 3.9 is the last to support Python 3.5, and PyCM 2.4 is the last to support Python 2.7 and 3.4.
Do I need extra packages to plot confusion matrices?
Yes. The source states that plotting requires Matplotlib (>= 3.0.0) or Seaborn (>= 0.9.1).
Is something wrong or out of date?

Tell us and an editor will check it.

Own this website?

Claim the listing and suggest updates yourself. An editor checks every claim first.

Claim this listing