# sepandhaghighi/pycm

Multi-class confusion matrix library in Python

Repository: https://github.com/sepandhaghighi/pycm
Canonical: https://ross.abutalabs.com/products/pycm
Homepage: http://pycm.io
Language: Python
License: MIT
License Family: permissive
Topics: machine-learning, confusion-matrix, matrix, statistics, statistical-analysis, accuracy, ml, ai, mathematics, data-mining, data-analysis, classification, data-science, data, neural-network, multiclass-classification, deep-learning, artificial-intelligence, deeplearning, evaluation
Last push: 2026-08-17T01:32:39+00:00

## Health v2 (maintenance only)
Score: 86/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 98, release rhythm 62, longevity 100
- inputs: {"age_days": 3145, "days_push": 17, "days_rel": 177, "gap_med": 88, "n_releases_24m": 6}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1506, forks 126 (observed 2026-08-28T04:04:54.981879+00:00)

## What it is
PyCM is a Python library for computing multi-class confusion matrices and a wide range of per-class and overall evaluation statistics. It accepts both actual/predicted vectors and direct matrices, making it a comprehensive post-classification model evaluation tool for data scientists.

## Use cases
- evaluate a multi-class classifier with confusion matrix metrics
- compute accuracy, precision, recall, and F1 scores in Python
- compare performance of several classification models
- generate a confusion matrix from predicted and actual label vectors
- get per-class and overall statistics for a predictive model
- analyze classification results for a research paper

## When to choose
- you need a broad array of confusion matrix statistics beyond what scikit-learn exposes
- you work with multi-class classification and want per-class and overall metrics in one tool
- you want to build a confusion matrix directly from a matrix or from label vectors

## When to avoid
- you only need simple binary accuracy and already use scikit-learn
- you need model training or hyperparameter tuning rather than evaluation
- you work outside the Python ecosystem

## Facets
- artifact type: library
- maturity: stable
- function: machine-learning, data-science, analytics, math
- domain: machine-learning, data-science, artificial-intelligence, analytics
- platform: python, cross-platform
- tags: confusion-matrix, classification-metrics, model-evaluation, statistics

## Member repositories
- sepandhaghighi/pycm (main) score 86

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:54.981879+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:32:40.932773+00:00, confidence not recorded.
  - readme: https://github.com/sepandhaghighi/pycm (fetched 2026-08-28T04:04:54.981879+00:00, sha 6e6cdf511803)
  - homepage: http://pycm.io (fetched 2026-08-29T11:37:17.754361+00:00, sha 69003e7a9edd)
  - registry_pypi: https://pypi.org/pypi/pycm/json (fetched 2026-08-29T11:37:17.763300+00:00, sha 60bde4fd2616)
- Data as of 2026-08-30T08:39:29.467469+00:00.
