## 4 Channel State Prediction via ML Algorithms
### Metrics of Interest  
As we described in Section 3.3, the row and column of a non-zero (or not equaling 200 before preprocessing) entry in an AoA/AoD frame \(V(s)\) characterize the angles of the received/departed rays, and the value of the element corresponds to the path loss of the received ray. Thus, such a frame-like data representation makes our prediction task a combination of classification and regression problems, because we need to predict the positions of non-zero elements in the matrix and also their values.  
Keras provides various metrics for evaluating regression and classification tasks [40]. To assess the performance of our proposed approach, we utilize the metrics _Precision_ and _Recall_ to quantify the accuracy of the coordinates and the mean squared error (MSE) to quantify the regression accuracy for the path loss value prediction. Let \(\hat{\mathcal{V}}^{(i)}=(\hat{\sigma}_{m,n}^{(i)})_{m=1,\ldots,K_{\phi},n=1, \ldots,K_{\phi}}\) denote the predicted value of \(V^{(i)}(S)\). Denote by \(\mathbf{1}\{A\}=\) indicator function such that \(\mathbf{1}\{A\}=\) 1 if \(A\) is true and \(\mathbf{1}\{A\}=\) 0 otherwise. Then, the numbers of true positive (TP), false positive (FP), and false negative (FN) results in the \(i\)-th data point can be computed, respectively, by  
\[N_{\text{TP}}^{(i)} =\sum_{m=1}^{K_{\phi}}\sum_{n=1}^{K_{\phi}}\mathbf{1}\{\hat{ \sigma}_{m,n}^{(i)}>\epsilon\}\mathbf{1}\{v_{m,n}^{(i)}(S)>\epsilon\}, \tag{12}\] \[N_{\text{FP}}^{(i)} =\sum_{m=1}^{K_{\phi}}\sum_{n=1}^{K_{\phi}}\mathbf{1}\{\hat{ \sigma}_{m,n}^{(i)}>\epsilon\}\mathbf{1}\{v_{m,n}^{(i)}(S)<\epsilon\},\] (13) \[N_{\text{FN}}^{(i)} =\sum_{m=1}^{K_{\phi}}\sum_{n=1}^{K_{\phi}}\mathbf{1}\{\hat{ \sigma}_{m,n}^{(i)}<\epsilon\}\mathbf{1}\{v_{m,n}^{(i)}(S)>\epsilon\}, \tag{14}\]  
where \(\epsilon\) is a threshold between 0 and 1.  
Now, the _Precision_ metric (or the positive predictive value, PPV), which measures the percentage of correctly identified non-empty clusters among all clusters predicted as non-empty, can be computed, for a dataset \(\mathcal{D}\), as  
\[Precision(\mathcal{D})=\frac{\sum_{i=1}^{|\mathcal{D}|}N_{\text{TP}}^{(i)}}{ \sum_{i=1}^{|\mathcal{D}|}N_{\text{TP}}^{(i)}+\sum_{i=1}^{|\mathcal{D}|}N_{ \text{FP}}^{(i)}}. \tag{15}\]  
_Recall_ (or sensitivity), which measures the percentage of non-empty clusters that were identified, is given by  
\[Recall(\mathcal{D})=\frac{\sum_{i=1}^{|\mathcal{D}|}N_{\text{TP}}^{(i)}}{ \sum_{i=1}^{|\mathcal{D}|}N_{\text{TP}}^{(i)}+\sum_{i=1}^{|\mathcal{D}|}N_{ \text{FN}}^{(i)}}. \tag{16}\]  
We note that _Precision_ and _Recall_ are often interrelated, and improving _Precision_ typically reduces _Recall_, and vice versa. Therefore, we tuned the threshold \(\epsilon\) of the two metrics to obtain the best value of prediction for both of them.  
Finally, MSE is closely related to the L2 distance considered previously, and is given by  
\[MSE(\mathcal{D})=\frac{1}{|\mathcal{D}|K_{\mathrm{\tiny{B}}}K_{\mathrm{\tiny{g}}} }\sum_{i=1}^{|\mathcal{D}|}\sum_{n=1}^{K_{\mathrm{\tiny{g}}}}\sum_{m=1}^{K_{ \mathrm{\tiny{g}}}}(\vartheta_{m,n}^{(i)}-v_{m,n}^{(i)}(S))^{2}. \tag{17}\]