Skip to content

Live package

PriorityX

Entity prioritization by volume and growth using GLMM statistical models

Entity prioritization for regulatory and operational monitoring, GLMM-based

GLMM
Model
PyPI
Package
2x2 Matrix
Output
Production
Status

Reading notes

What It Does

PriorityX helps answer a practical monitoring question: when there are hundreds of entities over time, which ones need attention first?

It uses Generalized Linear Mixed Models to estimate two scores per entity: volume, how far its baseline sits from its peers, and growth, which way its trajectory is heading. Each entity then lands in one quadrant of a 2x2 priority matrix for operational triage.

The package was built for regulatory operations, where teams needed to surface entities with rising risk patterns before they became bigger issues.

How It Works

Input. A DataFrame with an entity column, a timestamp column, and a metric column.

Scoring. The model estimates a random intercept and a random slope per entity, accounting for repeated observations.

Matrix. Each entity lands in one quadrant based on those two scores.

The Matrix

Growth flat or fallingGrowth rising
Volume above peersQ4 Low Priority: persistent baselineQ1 Critical: immediate attention
Volume below peersQ3 Monitor: routine trackingQ2 Investigate: emerging issue

Q1 additionally requires a minimum observation count, so a small sample cannot land an entity in the top quadrant on noise alone.

Why GLMM

Simple averages hide movement. An entity with moderate volume but a sharply rising trend may need attention before a chronic issue that has plateaued.

The two scores come from different parts of the same model:

  • x_score, the random intercept: the entity’s baseline volume relative to its peers
  • y_score, the random slope: its growth trajectory relative to its peers

Scores are relative to the population, not absolute. Under a Poisson fit they are on the log scale, so 0.5 means roughly 65% above average; under Gaussian or Gamma fits they are z-standardized so different metrics stay comparable.

Try It

pip install priorityx
import pandas as pd
import priorityx as px

df = pd.read_csv("data.csv")

results = px.fit_priority_matrix(
    df,
    entity_col="service",
    timestamp_col="date",
    temporal_granularity="quarterly",
)

px.plot_priority_matrix(results, entity_name="Service", save_plot=True)

Real Use

Consumer protection: surface investment products whose complaint volume is climbing.

Service reliability: rank endpoints by incident volume and trend.

Supply chain: detect supplier deterioration before failure becomes visible in aggregate averages.

Policy evaluation: compare regional improvement or regression after an intervention.