## 5 Applying Recurrent Neural Network (RNN) for Gene Expression Data Classification
### Calculating the Comprehensive Quality Criterion for the Classification of Gene Expression Data  
The analysis of the simulation results, presented hereinbefore, indicates challenges to determining the optimal architecture and hyperparameters of the neural network based on the combination of classification quality criteria used during the simulation process. The values of these criteria can be contradictory. Moreover, even a small difference in values can somewhat complicate selecting a list of optimal neural network hyperparameters. In this case, it is advisable to calculate a comprehensive quality criterion based on calculated individual criteria, such as sample classification accuracy, loss function value, and integrated F1-score value. Notably, higher accuracy and F1-score values and a lower loss function value correspond to a higher quality level of the model, i.e., an optimal network type and  
Figure 5: Results of modeling when applying a two-layer GRU recurrent neural network. The different colors in (c) correspond to different classes. Figure 6: Results of modeling when applying a three-layer GRU recurrent neural network. The different colors in (c) correspond to different classes. list of its hyperparameters. The calculation of the comprehensive quality criterion was performed using the weighted average method:  
\[QC_{w}=\sum_{k=1}^{n}weight_{k}\cdot QC_{k} \tag{12}\]  
where \(weight_{k}\) denotes the weight of the corresponding \(k\)-th quality criterion (\(QC_{k}\)). The algorithm for calculating the criterion (6) within the current research entails the following steps:  
1. Inverting the loss function value into a vector of values that increase with the model's attractiveness: \[loss^{\prime}_{k}=max(loss)-loss_{k}\] (13)
2. Scaling the values of all criteria within the range \([0,1]\): \[QC^{norm}_{k}=\frac{QC_{k}-min(QC)}{max(QC)-min(QC)}\] (14)
3. Initializing the weight vector for the utilized criteria. When calculating the comprehensive quality criterion for classification, it was assumed that the weight of the loss function value, calculated on the data for model validation of the neural network, was half as much as the weights of accuracy and integrated F1-score, which were calculated on the test data subset. Therefore, the weight vector for the criterion vector (\(ACC;F1_{i}nt,\ loss^{\prime}\)) was initialized as follows: \(w=(0.4,\ 0.4,\ 0.2)\). 4. Calculating the value of the comprehensive criterion using Formula (12): \[QC^{compr}_{k}=w[1]\cdot ACC^{norm}_{k}+w[2]\cdot F1^{norm}_{k}+w[3]\cdot loss ^{norm}_{k}\] (15)  
A higher value of this criterion corresponds to a better alternative. The proposed methodology was tested using results obtained in the previous subsections during the simulation of LSTM and GRU recurrent neural networks with various sets of hyperparameters. Figures 7 and 8 illustrate the distribution diagrams of the comprehensive quality criterion value for the performance of LSTM and GRU recurrent neural networks when using varying numbers of neurons and different amounts of recurrent layers. Figure 7: Distribution diagrams of the classification comprehensive quality criterion when using LSTM recurrent neural network. The analysis of the obtained simulation results allows us to conclude that in the case of using the LSTM model, a two-layer RNN with 35 neurons in the recurrent layer is optimal according to the comprehensive quality criterion. When applying the GRU model, the results are not unambiguous. A single-layer RNN with 55 neurons is appealing but not the best, according to the comprehensive quality criterion. A higher value of the comprehensive criterion corresponds to a single-layer RNN with 75 neurons in the recurrent layer. However, the maximum value of the criterion corresponds to a three-layer GRU recurrent neural network with 60 neurons in the convolutional layer. It is essential to consider the increased training time for the network.