model op• データ種: shapeset → shapemodel
• 呼び出し: import fullseye as fs; fs.ledger.shape_pca(shapes, n_components: 'int' = 0, align: 'bool' = True) (実装を直接呼ぶなら import shapestats; shapestats.shape_pca(shapes, n_components: 'int' = 0, align: 'bool' = True)、台帳から引くなら opsshapestat.get("shape_pca"))
形態 PCA(統計形状モデル)。→ dict(shapemodel)。
返す辞書: mean (N,3) / components (k, N*3) / variance (k,) / n_points / total_variance / aligned (K,N,3)。
n_components=0(既定)は min(K-1, N*3) 本すべて。align=True なら先に generalized_procrustes を掛ける(揃えずに PCA を取ると、第 1 主成分が「位置の違い」になって形の話が消える)。
★ 分散は標本分散(K-1 で割る)。K が小さいと固有値は系統的に大きく出る。個体数が二桁に届かないうちは、固有値そのものより比を見ること。
★★ align=True は「大きさの違い」も消すので、大きさに近いモードの分散を食う。 shape_synth_family は第 1 モードを「長軸の伸び縮み」、第 2 を「曲げ」にしてあり、重みの比は 0.30 : 0.12 なので分散比の真値は 6.25。実測(K=40、N=80、seed=7):
========================== ========== ======================
前処理 分散比 寄与率(第 1 / 第 2)
========================== ========== ======================
align=False 6.981 0.8747 / 0.1253
GPA(scaling=False) 6.981 0.8747 / 0.1253
align=True(既定) 2.565 0.7188 / 0.2803
========================== ========== ======================
伸びは一様拡大とよく似ているので、Procrustes のスケール除去がその半分以上を持っていく。間違いではなく定義の帰結 —— 「大きさを形質に数えるか」を先に決めていないと、同じデータから違う主成分が出る。成長や体格差を形の話に含めたいなら align=False(または generalized_procrustes(scaling=False) を通してから align=False)にすること。
• サンプルデータ カタログ(DL URL / ライセンス) — 2-D は skimage.data(BSD/public)+ 合成、3-D は実データ源(Stanford/PDS 等)の DL URL。
• 演算子の来歴・参考文献 — この op 族の元になった研究/手法の出典。
• アルゴリズムの正典(著者・年)と用途は上記ファミリ使い方ガイドに記載。
• shapestat_landmark_tour — py -3.11 examples/shapestat_landmark_tour.py
shapemodel を入力に取れる)shape_project · shape_reconstruct · shape_mahalanobis · shape_explained_variance · shape_synthesize
model)shape_project · shape_reconstruct · shape_mahalanobis · shape_explained_variance · shape_synthesize
*Provenance: shapestats.py — SHAPESTAT operator registry. この per-op ノートは tools/opdocs.py md が自動生成(手編集しない)。*
© 2026 Kazufumi Furuse — Fullseye operator documentation. Licensed under Apache-2.0.