# Terahertz Time-Domain Spectroscopy of Glioma Patient Blood Plasma: Diagnosis and Treatment
## 3 Results  
In Figure 3a we present mean time-resolved THz signals for each group, and in Figure 3b the same graphs but compared to the reference THz signal from an empty cuvette. The time delay and decrease in the signal amplitude when the sample was introduced into the cuvette was associated with the plasma impact in the THz wave transformation. The THz signal for healthy donors was shown to have a smaller amplitude, and was mixed to the right by 0.25 ps relative to the samples of patients with and without glioma, which show similar trends in the overall shape of the curve with a small difference in the THz signal amplitude. The mean and variance of THz intensity spectra of each group of samples are shown in Figure 4.  
At the first stage, the optimal window size (\"window_length\" parameter) for the Savitzky-Golay filter (scipy.signal.savgol filter package was used) was evaluated using averaged estimates of Sensitivity (SE), Specificity (SP), Accuracy (ACC), Precision (PR) over five-fold cross-validation of SVM, RF, and XGBoost methods. The fitting polynomial order (\"polyorder\" parameter) was chosen to equal 2, because the third order over-smooths THz spectra, while the first order does not have a significant impact. According to Table 1, the optimal value for window size is 5 because the majority of metrics are higher than for other values. \begin{table}
\begin{tabular}{c c c c c} \hline \hline \multicolumn{1}{c}{**“Window_Length” Value**} & **5** & **15** & **31** & **No Smoothing** \\ \hline Average SE of SVM/RF/XGBoost & 0.60/0.62/0.68 & 0.60/0.57/0.58 & 0.70/0.52/0.68 & 0.60/0.57/0.58 \\ \hline Average SP of SVM/RF/XGBoost & 0.47/0.50/0.50 & 0.39/0.47/0.44 & 0.28/0.42/0.42 & 0.60/0.57/0.58 \\ \hline Average ACC of SVM/RF/XGBoost & 0.55/0.57/0.61 & 0.52/0.53/0.53 & 0.54/0.48/0.58 & 0.60/0.57/0.58 \\ \hline Average PR of SVM/RF/XGBoost & 0.65/0.67/0.69 & 0.62/0.64/0.64 & 0.62/0.60/0.66 & 0.60/0.57/0.58 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Estimation of the “window_length” parameter optimal values for the Savitzky–Golay filter. Figure 3: Mean time-resolved THz signals for each group (**a**), and the same graphs but compared to the reference signal (**b**): glioma patients (red line), healthy donors (blue line), patients with SDC (green line), and reference signal (dotted line). At the second stage, data dimensionality reduction was conducted using the PCA and t-SNE methods. In Figure 5, we present the t-SNE visualization. Numbers near markers correspond to the sample ID in each group. Groups are marked by different colors. T-SNE relies on the distance between original spectra, so it does not matter how many groups are under study, contrary to PCA. In Figure 5, we can verify that spectra recorded from one sample are similar. Additionally, tumor and healthy samples form large clusters, but there are outliers. Figure 4: Mean THz intensity spectra for blood plasma of glioma patients (red line), healthy donors (blue line), and patients with SCD (green line). All data points have their own bar (vertical line), representing data variance. Figure 5: T-SNE visualization. Numbers near markers correspond to the sample ID. The broken stick method for the cumulative explained variance plot is widely used to select an appropriate combination of principal components (PCs) (see Supplementary Materials, Figure S1). A high value of explained variance does not guarantee the best data separation [60]. We were restricted ourselves by using 10 PCs with highest explained variance to achieve an acceptable-to-analyze amount of data (here, the factorial dependence of the number of pairwise combinations on the number of PCs), and to take into account components with a large explained variance, since they often contain important information. Additionally, we tested PCA with and without data standardization and found that, without standardization, it performs better. A possible reason for this is that the THz spectra of studied groups differ in amplitude.