# Advancing Spanish Speech Emotion Recognition: A Comprehensive Benchmark of Pre-Trained Models
## 3 Materials and Methods
### Classifier Training  
The embeddings extracted from the PTMs serve as inputs for three classifiers: KNN, SVM, and MLP. These models are simple and well-established in the SER literature [21; 23; 25], allowing for interpretable results and isolating the contribution of embeddings without the added complexity of end-to-end systems. Additionally, although more complex models could be used, the focus of this study is not on maximizing computational power but rather on evaluating the quality of the embeddings. Therefore, using lightweight models reduces computational requirements and allows for a more focused analysis, while also ensuring reproducibility and mitigating overfitting risks.  
Hyperparameter optimization is performed using a grid or randomized search with cross-validation. The classification algorithms used are described below.  
1. K-Nearest Neighbors. The KNN algorithm is a non-parametric and lazy learning method used for classification and regression. KNN classification is performed by identifying the \(K\) nearest neighbors to a query point using a distance metric, such as the Euclidean distance. The optimal value of \(K\) and the nearest neighbors are determined through a search process that can involve techniques like Ktree and K*tree, where neighbor calculations are optimized using tree-like structures. Advanced methods, such as the one-step KNN, reduce neighbor calculation to a single matrix operation that integrates both \(K\) adjustment and neighbor search, using least squares loss functions and sparse regularization (like group lasso) to generate a relationship matrix containing the optimal neighbors and their corresponding weights [83].
2. Support Vector Machine. SVMs are supervised learning algorithms used for classification and regression designed to identify the optimal separating hyperplane in a high-dimensional space that maximizes the margin between points from different classes. For non-linear problems, SVM employs kernel functions to project data into higher-dimensional spaces where linear separation becomes feasible. The maximum margin is expressed as \(\frac{1}{\|w\|}\), where \(w\) is the weight vector. The optimization problem is formulated as minimizing \(||w||^{2}\) under correct classification constraints, and in cases where the margin cannot be strictly maintained, slack variables are introduced to allow some classification flexibility [84; 85].
3. Multi-Layer Perceptron. MLPs are artificial neural networks consisting of interconnected layers of nodes, where each node in intermediate and output layers applies a non-linear activation function (such as sigmoid or hyperbolic tangent). MLP training is typically performed using backpropagation, which adjusts the weights via gradient descent to minimize the mean squared error (MSE) between predicted and expected outputs. The mathematical model of an MLP can be expressed as: \[y=f(W_{2}\cdot f(W_{1}\cdot x+b_{1})+b_{2})\] where \(W_{1}\) and \(W_{2}\) are weight matrices, \(b_{1}\) and \(b_{2}\) are bias vectors, and \(f\) is the non-linear activation function [86].