# Investigating Shape Variation Using Generalized Procrustes Analysis and Machine Learning
## 2 Materials and Methods
### Investigation of Morphological Diversity
#### 2.4.2 Consensus Clustering  
Finding consensus in several cluster models or clustering ensembles [35] may be used to combine evidence unveiled by different models. The principle of co-association [33] is a model-free methodology, where the consensus of several cluster models is found by analyzing the pairwise occurrence of samples in the same cluster in several partitions. The cluster model \(i\) results in a partition \(P_{i}=\{C_{1}^{i},\dots,C_{k}^{i}\}\), where \(C_{m}^{n}\) is the m-th cluster in the n-th partition. All models results in the set \(\{P_{1},\dots,P_{m}\}\). The co-association (CA) of samples \(j\) and \(k\) relying on \(m\) cluster models is measured by  
\[CA_{j,k}=\frac{1}{m}\sum_{t=1}^{m}\delta\big{(}P_{t}(\vec{x}_{j}),P_{t}(\vec{x} _{k})\big{)}. \tag{4}\]  
The function \(\delta(. )\) returns 1 if both samples happens to be in the same cluster in partition \(P_{t}\). This methodology results in the co-association matrix, where the entries at \(j,k\) is \(CA_{j,k}\)After the investigation of all \(m\) clustering models, the co-association matrix contains a consensus about all models. We propose a probabilistic extension of this method referred to as probabilistic co-association (pCA), where the cluster uncertainty is included. On one hand, this extension includes the probabilistic perspective of the structural investigation and allows on the other hand hypothesis testing. To investigate the pCA, the probabilistic formulation of Equation (4) is the probability of two samples \(m\) and \(n\) happens to be in the same cluster \(j\) of partition \(p\). This probability is calculated using  
\[p(_{p}CA_{(m,n)}|\vec{f}_{m,n})=p(_{p}z_{j}^{m}=1,_{p}z_{j}^{n}=1|\vec{f}_{m}, \vec{f}_{n})=p(_{p}z_{j}^{m}=1|\vec{f}_{m})p(_{p}z_{j}^{n}=1|\vec{f}_{n}). \tag{5}\]  
The variable \({}_{p}z_{j}^{m}\) indicates the affiliation of sample \(m\) to cluster \(j\) in partition \(p\). Assuming that the \(p\) cluster models are independent given the features, we can estimate the co-association \(CA_{m,n}\) between sample \(m\) and \(n\) by  
\[p(CA_{m,n}|\vec{f}_{m,n})=p(_{1}CA_{m,n},\ldots,_{p}CA_{m,n}|\vec{f}_{m},\vec{ f}_{n})=\prod_{t=1}^{p}p(_{t}CA_{m,n}|\vec{f}_{m,n}). \tag{6}\]  
In this analysis, we assume that specimens belonging to the same population cluster happen to be in the same model cluster with a higher frequency as well as higher probability than specimens from different clusters. We visualize the conditional probability of \(CA_{m,n}\) in a \(n\times n\) matrix referred as the pCA matrix. Specimens that happen to be frequently in the same cluster appear bright in the entries of the pCA matrix. Finally, the performance of the probabilistic consensus clustering for morphological data is evaluated. This evaluation is performed by analyzing the population intra co-association to the inter co-association. In a biological context, this analysis investigates the visual similarity of the specimens to the true population location and foreign population locations. We formulate a hypothesis test relying on the Bayes factor [68], where we evaluate the probabilistic consensus of inter-population specimens. The intra co-association is measured by analyzing the similarity of a specimen \(i\in loc\) to all members of the location \(loc\) using the pCA. The inter location co-association is measured by analyzing the similarity \(i\
otin loc\) to all specimens belonging to another location. If the method used for visual information extraction results in useful information, the intra co-association will exceed the inter co-association. Note, that we use a priori knowledge in this test, namely the known specimen population location. The test is implemented using  
\[\mathcal{B}_{loc}=\prod_{i=1}^{N}\frac{\sum_{n\in loc\setminus i}p(CA_{i,n}| \vec{f}_{i,n})}{\sum_{n\
otin loc}p(CA_{i,n}|\vec{f}_{i,n})}. \tag{7}\]  
The index \(n\in loc\setminus i\) describes all members of the populations location \(loc\) without the actual specimen \(i\) of the population.