## 2 Materials and Methods
### Data Analysis
#### 2.4.2 Work of Breathing Estimation
\[H(X)=-\sum p(X)log_{2}p(x) \tag{5}\]  
where p(X) is the probability density function of index X. The indexes were sorted from higher to lower mutual information, and each one was examined with a multiple comparisons test. 3. Kruskal-Wallis and Post Hoc Analysis  
The indexes selected with each one of the algorithms were examined with the Kruskal-Wallis test followed by the post hoc Tukey-Kramer multiple comparisons correction and Mann-Whitney tests on each pair of groups. Only the indexes that separate statistically (p-value \(<\) 0.05) in any of the groups were considered in the machine learning process. \(\bullet\) Machine Learning  
Steps 2.1 and 2.2 in Figure 3 identify the respiratory muscular pattern and the WOB level, respectively. Due to the fact that in clinical practice, knowing the ventilatory pattern is not common, its identification is necessary before the WOB level classification. In this study, the ventilatory pattern was defined according to the respiratory muscular activity, in order to know what muscles, participate in the ventilatory process. Several supervised learning techniques were selected according to their wide and successful use in classifying biomedical data [18]. The techniques tested were: LDA, SVM, KNN, an ensemble algorithm, and NN. The parameters of the three first classifiers (LDA, SVM, and KNN) were optimizedusing the Bayesian optimization through the option of the MATLAB algorithms. In the case of the Neural Network, three hidden layer sizes, with default values of 10, 5 and 20, were tested. Table 2 shows the parameters obtained for greater accuracy (see Table 2). For linear discriminant analysis (LDA), the indexes of sEMG were logarithmically transformed based on the fundamental assumption of normally distributed variables for this method. Indexes were standardized for the algorithms where the assumption is not applicable [37] (see configuration details in Table 2). An ensemble technique was implemented to enhance the power of single classification techniques, looking to combine single classifiers through different strategies. In this study, the stacking algorithm was selected to combine three single classifiers or supervised methods (LDA, SVM, and KNN). \begin{table}
\begin{tabular}{c c c} \hline \hline  & **Respiratory Muscular Pattern** & \\ \hline
**Classifier Algorithm** & **Configuration** & **Validation** \\ \hline  & **Gamma = 0** & \\ LDA & **Delta = 0** & \\  & **Discriminant type: linear** & \\  & **Indexes: logarithmic transformed** & \\ \hline  & **Box Constraint = 962.47** & \\ SVM & **Kernel Scale = 8.4** & \\  & **Kernel Function: Gaussian** & \\  & **Indexes: Standardized** & \\ \hline  & **Distance: Euclidean** & \\ KNN & **Number of Neighbors: 2** & \\  & **Indexes: Standardized** & \\ \hline  & **WOB LEVEL** & \\ \hline
**Classifier Algorithm** & **Experiment 1** & **Experiment 2** & \\ \cline{2-3}  & **Configuration** & **Configuration** & \\ \hline  & **Gamma = 0.49** & \\ LDA & **Delta = \(0.06\)** & \\  & **Discriminant type: linear** & \\  & **Indexes: logarithmic transformed** & \\ \hline  & **Box Constraint = 1** & **Box Constraint = 0.7416** & \\ SVM & **Kernel Scale = 1** & **Kernel Scale = 110.77** & \\  & **Kernel Function: Gaussian** & \\  & **Indexes: Standardized** & \\ \hline  & **Distance: Euclidean** & \\ KNN & **Number of Neighbors: 2** & **K-fold 20\%** \\  & **Indexes: Standardized** & \\ \hline  & **Distance: Euclidean** & \\ META-CLASSIFIER KNN & **Number of Neighbors: 2** & **K-fold 20\%** \\  & **Number of Neighbors: 2** & **K-fold 20\%** \\  & **Indexes: Standardized** & \\ \hline  & **Training function: Levenberg-Marquardt** & \\  & **hidden layer: 1** & \\ NN & **hidden layer sizes: 10** & \\  & **input layer sizes: 4** & \\  & **output layer sizes: 3** & \\  & **Indexes: Standardized** & \\ \hline \hline \end{tabular}
\end{table} 
Table 2: Information about configuration and validation of each of the classification algorithms.