# EEG Pattern Classification of Picking and Coordination Using Anonymous Random Walks
## 3 Data Processing and Analysis
### Coherence Pattern Classification Based on Anonymous Walk Approach  
In the previous section, the random forest classifier managed to differentiate electrophysiological activity represented by a graph based on coherence that was related to two classes only, non-task-related and task-related activity. The features that were fed into the classifier were based on the bag of nodes embedding method. The output of bag of nodes is a vector representation of the node degree distribution of the entire graph achieved by quantifying the degree for each node individually. Hence, this method is agnostic to different spatial paths in the graph. In view of the above, we aimed to use a graph embedding method sensitive to the spatial properties of the entire graph, such as [35; 36], which showed how a spatial graph embedding could be implemented by summing or averaging node embeddings such as node2 vec [25; 37] or deep-walk [25; 38]. Another method introduced by [39] suggested to \begin{table}
\begin{tabular}{c c c c c c} \hline \hline  & & \multicolumn{2}{c}{**Predicted Classes**} & \multicolumn{1}{c}{**True**} & \multicolumn{1}{c}{**False**} \\ \cline{2-6}  & \multicolumn{1}{c}{**Resting State**} & \multicolumn{1}{c}{**Picking**} & \multicolumn{1}{c}{**Coordination**} & \multicolumn{1}{c}{**Positive**} & \multicolumn{1}{c}{**Negative**} \\  & \multicolumn{1}{c}{\(p\) = [1;0;0]} & \multicolumn{1}{c}{\(p\) = [0;1;0]} & \multicolumn{1}{c}{\(p\) = [0;0;1]} & \multicolumn{1}{c}{**Rate**} & \multicolumn{1}{c}{**Rate**} \\ \hline \multirow{4}{*}{\begin{tabular}{c} **True** \\ **Classes** \\ \end{tabular} } & Resting State & \multirow{2}{*}{592} & \multirow{2}{*}{8} & \multirow{2}{*}{0} & \multirow{2}{*}{98.66\%} & \multirow{2}{*}{1.34\%} \\  & \(p\) = [1;0;0] & & & & & \\ \cline{1-1} \cline{5-6}  & \(\begin{array}{c}\text{Picking}\\ \text{$p$ = [0;1;0]}\end{array}\) & & & & & & \\ \cline{1-1} \cline{5-6}  & \(\begin{array}{c}\text{Coordination}\\ \text{$p$ = [0;0;1]}\end{array}\) & & & & & & \\ \hline \multirow{2}{*}{\begin{tabular}{c} **Positive Predicted Value** \\ \end{tabular} } & Resting State & \multirow{2}{*}{2} & \multirow{2}{*}{41} & \multirow{2}{*}{77} & \multirow{2}{*}{64.16\%} & \multirow{2}{*}{35.84\%} \\  & \(p\) = [1;0;0] & & & & & \\ \hline \multirow{2}{*}{\
\begin{tabular}{c} **False Discovery Rate** \\ \end{tabular} } & \multirow{2}{*}{1.01\%} & \multirow{2}{*}{41.18\%} & \multirow{2}{*}{37.40\%} & \multirow{2}{*}{37.40\%} & \multirow{2}{*}{
\begin{tabular}{c} **Total Prediction Accuracy** \\ **(770/840)** \\ **91.66\%** \\ \end{tabular} } \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Multiclass classification results—random forest using bag of node degrees. define a virtual node to model the entire graph embedding using standard node embedding techniques. In the current study, we used anonymous random walks to spatially encode the entire graph structure without relying on data at the level of individual nodes. Anonymous random walks enable us to encapsulate the structure of a graph regardless of the specific node labels. That is, random walks that visited different nodes in the same sequence will result in the same anonymous walk encoding [24]. The number of anonymous walks increases exponentially as a function of the anonymous walk length, as presented in Figure 4. The minimal number of random walks needed to achieve a reliable distribution is calculated using Equation (3) (e.g., [37]):  
\[m=\frac{2}{\varepsilon^{2}}\left(\log\left(2^{N}-2\right)-\log(\delta)\right) \tag{3}\]  
where \(N\) (the Y-axis in Figure 4) is the number of possible anonymous walk patterns for an anonymous walk of a specific length (the X-axis in Figure 4). The distribution of anonymous walks has an error of no more than (\(\varepsilon\)) with probability less than (\(\delta\)) relative to the optimal distribution (\(m\rightarrow\infty\)).