shape_explained_variance — SHAPESTAT model op

• Data kinds: shapemodel → signal

• Call: import fullseye as fs; fs.ledger.shape_explained_variance(model) (to call the implementation directly, import shapestats; shapestats.shape_explained_variance(model); from the registry, opsshapestat.get("shape_explained_variance"))

Usage

Explained-variance ratio of each principal component (sums to 1). → (k,).

Formula: variance / total_variance. The denominator is model["total_variance"] (the total variance that shape_pca computed from all singular values), or variance.sum() if absent.

• model: return value of shape_pca. If a required key is missing, ValueError.

• Returns: (k,) float64, each element in [0, 1]. For shape_pca(n_components=0) (all components) the sum is 1. For a model truncated by n_components the sum is below 1 (short by the truncated components) -- for reading "how much the top k components explain" that is in fact the correct behaviour.

• If the total variance is 0 (all individuals have the same shape), all elements are 0 (no division by 0).

The variance of shape_pca is the sample variance (divided by K-1), so with few individuals the absolute eigenvalues inflate, but this quantity, being a ratio, is hardly affected. Use the cumulative sum (cumsum) to decide "how many components are needed for 99 %", and pass that to cumulative of shape_mahalanobis or n_modes of shape_synthesize.

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 signal as input)

shape_reconstruct

Same category (model)

shape_pca · shape_project · shape_reconstruct · shape_mahalanobis · 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.