shape_pca — SHAPESTAT 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)。

詳細使用指南

• shape_statistics 族使用指南

參考(範例資料、文獻)

• 範例資料目錄(下載 URL / 授權) —— 2-D 用 skimage.data(BSD/公有領域)加合成圖,3-D 給出真實資料源(Stanford/PDS 等)的下載 URL。

• 運算子來歷與參考文獻 —— 該運算子族所依據的研究/方法出處。

• 演算法的正典(作者、年份)與用途見上面的族使用指南。

可執行的範例(實際呼叫該運算子並已驗證的樣例)

• 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 運算子登記表。本條目由 tools/opdocs.py md 自動產生(請勿手動編輯)。*

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