## 3 Experimental Results  
### K-means  
The K-means algorithm [27; 28] underwent testing through two approaches. Firstly, it was applied to the feature matrix acquired without data modifications or normalization as depicted in Table 1.  
Figure 3: Protocol and parameters used during experiments with each unsupervised classification method.  
Figure 5: K-means clustering with normalized data: (**a**) elbow graph for spikes in the monkey signal, (**b**) elbow graph for spikes in the human pancreatic signal, (**c**) clusters/groups for the spikes in the monkey signal, and (**d**) clusters/groups for the spikes in the human pancreatic signal.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Group** & **Spike Shape** & **Number of Spikes** \\ \hline
0 & & 147 \\ \hline
1 & & 113 \\ \hline
2 & & 24 \\ \hline \hline \end{tabular}
\end{table}
Table 4: Spikes groups formed with K-means for the monkey signal (before normalization).  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Group** & **Spike Shape** & **Number of Spikes** \\ \hline
0 & 52 \\ \hline
1 & 62 \\ \hline
2 & 101 \\ \hline
3 & 116 \\ \hline \hline \end{tabular}
\end{table}
Table 6: Spikes groups formed with K-means for the human pancreatic signal (after normalization).  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Group** & **Spike Shape** & **Number of Spikes** \\ \hline
0-0 & 8 \\ \hline
0-1 & 59 \\ \hline
0-2 & 67 \\ \hline \hline \end{tabular}
\end{table}
Table 5: Spikes groups formed with K-means for the monkey signal (after normalization).  
Although these action potentials have similar amplitude and shape, some differences can be perceived between them, mainly after the repolarization stage of the potential. Figure 6 shows the differences in these three spikes.  
Figure 7 presents a three-dimensional representation illustrating the distinctive spike shapes within each group formed from the detected spikes within the monkey signal. In this visualization, the three spike types outlined in Figure 6 are prominently discernible. Moreover, other detected shapes from the lower groups are also depicted, revealing a range of spike patterns. Notably, while certain shapes correspond to noise eliminated during the potential detection stage, others signify spikes resembling action potentials. However, the clustering method encounters challenges in distinguishing these from the noise. This confusion arises because some of these spikes share the same amplitude level as the detected noise, underscoring the complexity of isolating genuine action potentials in the presence of signal artifacts.  
Figure 6: Differences of the spike shapes in Table 5.  
Figure 7: A 3D representation of the groups for the spikes in the monkey signal after normalization.  
Five distinct groups emerge after applying K-means to the detected spikes within the human pancreatic signal. Among these, groups 1 and 4 yield the most favorable outcomes. Notably, in these groups, the spike shapes are distinctly defined, in contrast to the remaining groups, where residual noise in the spike shapes persists. This phenomenon arises due to the complexity of this particular signal, whose amplitude is in the nV range, which can clearly be mistaken for noise (see Figure A1b).  
Upon observing the data distribution graphs in Figure 5c,d, it becomes evident that while distinct groups are identifiable, some clusters remain in close proximity to each other. This proximity raises the potential for confusion within the K-means algorithm, as certain clusters contain elements mixed with their neighboring counterparts. Consequently, spikes become challenging to differentiate, leading to their association with clusters, suppressing noise detection. To address this issue, Principal Component Analysis (PCA) was integrated for dimensionality reduction, aiming to enhance outcomes using the K-means method. The PCA method is described in the following section.