## 2 Materials and Methods
### Methodology
#### 2.2.3 Multivariate Statistics and Machine Learning  
A selection of principal component (PC) scores obtained after PCA that in sum represent up to 95% of the total variance were used to account for morphological differentiation between carnivore species, based on the tooth scores they generate. The power of discrimination between the different groups and predictions on tooth score classification was explored using Multivariate Analyses of Variance (MANOVA), Machine Learning (ML) models, and Neural Networks (NN). First, Shapiro tests were performed to evaluate sample distributions [53]; the certification of non-Gaussian distributions in our samples led to the use of robust statistical methods [54; 55], such as [PERSON]'s Lambda test statistic for MANOVA [56]. A \(p\)-value threshold of 0.003 was adopted for defining statistical significance, as it provides a lower risk of being a false positive (4.5% risk of being Type I error) in comparison to the usually adopted 0.05 threshold (28.9% risk of being a Type I error) [54]. The R libraries _stats_ and _RVAidedMemoire_[57] were used to perform these tests. On the other hand, ML models and NN were trained by dividing the sample into a training (70% of the sample) and testing set (the remaining 30% of the sample) that is used for model evaluation. Among the ML models tested for the present study, usually the most efficient ones are based on the use of CART Trees (classification and regression trees), gradient boosted machines (GBM), and support vector machines (SVM). A recursive partitioning of data using k-fold cross-validation (\(k=10\)) was performed, so that the models could adjust their weights and internal parameters using training and validation sets. Trees offer comprehensible and robust techniques based on a recursive partitioning of the data. Tree models are characterized by a scheme made upon bifurcations defined by a series of variables, which ultimately end up in terminal nodes as the result of classification. Models based on trees allow tuning several parameters to enhance prediction performance (e.g., the number of trees, the depth of trees, the number of variables per split, the number of terminal nodes, etc.). The tree-based algorithms used in the present study can be found in the _party_[58] and _caret_[59] R libraries. GBM algorithms also provide solutions based on the building of trees. In this case, the algorithm creates an ensemble of trees that successively learn from the preceding one, thus improving previous results. The large computational effort demanded by such algorithms can be slightly controlled by altering the learning rate into the direction of the minimum error. The general idea of gradient descent is to tweak parameters iteratively in order to minimize a cost function. For that purpose, a hyperparameter grid was built with up with 200 trees (iterations), with depths from 4 to 14, and between 5 and 50 splits (border count), a learning rate from 0.01 to 0.5, and a cost function between 0.1 and 5, additionally using \(L_{2}\) regularization. Attempts to avoid overfitting were carried out using cross-validation methods. Several functions included in the _caret_[59] library were implemented. SVMs are flexible models that use a kernel-trick to adjust for parametric components, such as linearity, allowing the construction of non-linear decision boundaries, in addition to soft maximized-margins that help to avoid the overfitting of the training data. For this study, SVM with a Radial Basis Function (RBF) was used [60]. For the selection of each SVM's optimal cost (c) and gamma (\(\gamma\)) hyperparameters, Bayesian Optimization Algorithms (BOAs) were employed [61; 62; 63]. BOA was adjusted using a random optimization algorithm to define the prior distribution for hyperparameter selection [63], followed by an Expected Improvement (EI) BOA algorithm for 50 iterations [63; 64]. SVM applications were performed using the _caret_[59] library. Finally, simple models of NN were applied.