# Application of Machine Learning Algorithms for Prediction of Tumor T-Cell Immunogens
## 3 Results and Discussion  
A dataset comprising 212 antigenic and immunogenic, and 212 antigenic but non-immunogenic, peptides was assembled following the methodology delineated previously. This dataset was partitioned into a training set consisting of 170 immunogenic and 170 non-immunogenic peptides, and a test set comprising 42 immunogenic and 42 non-immunogenic peptides. Each peptide was numerically represented as strings of 5\(n\) _E_-descriptors, where \(n\) denotes the number of amino acid residues. To standardize the representation, the strings of varying lengths were subjected to _ACC_-transformation with a \(L\) = 7. The _lag_ value of 7 was chosen as the length of the shortest peptide in the dataset. Consequently, the training set was transformed into a 340 \(\times\) 175 (7 \(\times\) 5\({}^{2}\)) matrix, while the test set was converted into an 84 \(\times\) 175 matrix. The flowchart of data preprocessing is presented in Figure 1.  
Six supervised machine learning algorithms were employed to construct classification models for predicting immunogenicity, utilizing the training set. To enhance the precision of the models, their hyperparameters underwent tuning via the grid search algorithm in combination with 10-fold cross-validation on the training set. This method entails predefined dictionaries encompassing hyperparameters and their respective value ranges, with the model evaluated across all feasible combinations employing cross-validation. Optimal hyperparameters were determined for each model as follows: the \(k\)NN model exhibited its peak predictive performance at \(k\) = 2, while the LDA method demonstrated superior predictions with _solver = svd_. Similarly, the QDA model achieved its highest performance with _reg_param = 0.0_. The SVM method reached its apex predictive capabilities with parameters \(C\) = 2, _gamma = 10_, and _kernel = rbf_. Furthermore, the RF model displayed optimal predictions with _max_depth = 80_, _max_features = 2_, and _n_estimators = 300_. Lastly, the XGBoost method showcased its highest performance with _learning_rate = 0.3_, _max_depth = 3_, and _n_estimators = 100_. The performance of the models on the training set is presented on Table 2. The \(k\)NN model demonstrated the best recognition capabilities for classifying the immunogenic peptides (_sensitivity = 0.95_), but a very poor performance on the non-immunogenic peptides (_specificity = 0.29_). Both LDA and QDA models demonstrated poor overall performance regarding both classes. In contrast, SVM and XGBoost models showcased balanced performances, demonstrating robust predictive capabilities for both immunogenic and non-immunogenic peptides. The RF model exhibited the highest accuracy, primarily at  
Figure 1: Flowchart of data preprocessing. tributed to its superior predictive ability for non-immunogens (_specificity_ 0.9). While the RF model's capability to predict immunogens was relatively strong (_sensitivity_ 0.72), it was lower compared to its performance in predicting non-immunogens. Once the models were trained, they underwent subsequent evaluation on the hold-out test set to give an objective conclusion about their generalization capabilities (Table 3). The observed results align well with the ones seen on the training set, indicating lack of overfitting. Although exceling in the recognition of immunogens, the \(k\)NN model exhibited a notably poor performance when classifying the non-immunogenic peptides, rendering it unsuitable for effective classification. Conversely, both the LDA and QDA models demonstrated subpar overall performance across various metrics. The SVM, RF, and XGBoost models emerged as the most promising predictive models, displaying balanced and robust performances across all evaluated metrics. Consequently, these models were selected for further validation. Initially, Y-scrambling was conducted for each of the SVM, RF, and XGBoost models.