shape_mahalanobis — SHAPESTAT model op

• Data kinds: shapemodel × points → measurement

• Call: import fullseye as fs; fs.ledger.shape_mahalanobis(model, shape, align: 'bool' = True, cumulative: 'float' = 0.99, n_modes: 'int' = 0) (to call the implementation directly, import shapestats; shapestats.shape_mahalanobis(model, shape, align: 'bool' = True, cumulative: 'float' = 0.99, n_modes: 'int' = 0); from the registry, opsshapestat.get("shape_mahalanobis"))

Usage

How abnormal the shape is as seen from the model. → float.

Adds up sqrt(sum(score_i^2 / variance_i)) restricted to the first few components.

★ Do not add up all components. A group of K individuals yields K-1 principal components, but toward the end the variance drops to numerical zero. Variances measured (K=12, N=80, true modes:

2): 3.2e-02, 5.6e-03, 4.0e-05, 6.7e-13, 9.7e-14, 9.9e-17, …, 1.0e-31. Dividing by this tail makes the value meaningless:

========== =========== ==================

modes used in group 0.5 bulge injected

========== =========== ==================

1 0.428 1.821

2 0.885 2.617

3 1.035 18.134

5 1.373 1393035.060

11 (all) 46613.636 9.3e+13

========== =========== ==================

With 5 components an in-group individual scores 1.37 while the outlier scores in the millions, and with 11 even the in-group scores 46614. What is measured is not "abnormality" but "how many times it divided by numerical zero".

Hence the default uses only the components up to the cumulative contribution cumulative (0.99). For the group above 2 components (0.99895) are chosen, and in-group 0.885 / outlier 2.617 line up sensibly. Giving n_modes a positive number fixes the count to that number (used when you want the same count for comparison). The value changes depending on which you used, so when reporting, give the count too.

Detailed usage guide

• shape_statistics family guide

References (sample data, literature)

• Sample-data catalog (download URLs / licences) — 2-D uses skimage.data (BSD/public domain) plus synthetic images; 3-D lists download URLs for real data sources (Stanford, PDS, …).

• Operator provenance and references — the sources of the research/methods this op family came from.

• The canonical algorithm (author, year) and its uses are named in the family usage guide above.

Runnable examples (verified samples that actually call this op)

• shapestat_landmark_tour — py -3.11 examples/shapestat_landmark_tour.py

Ops the type connects to (they accept measurement as input)

—

Same category (model)

shape_pca · shape_project · shape_reconstruct · shape_explained_variance · shape_synthesize


*Provenance: shapestats.py — SHAPESTAT operator registry. This per-op note is generated by tools/opdocs.py md (do not hand-edit).*

© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.