## 3 Experimental Results
### Hierarchical Clustering  
Like the K-means method, hierarchical clustering is an unsupervised algorithm [31; 32]. This technique constructs a series of nested clusters, forming a hierarchy typically visualized as a tree-like structure known as a dendrogram. This graph provides a visual representation of the cluster hierarchy. The hierarchical clustering process follows a bottom-up approach, where each data point initiates as an independent cluster, subsequently merging clusters based on a chosen metric (e.g., Euclidean distance). In other words, the algorithm treats each sample as an individual cluster and employs a defined merging strategy to combine clusters progressively. This iterative merging continues until the top of the tree is reached, culminating in forming the root cluster that encompasses all samples. In the hierarchical clustering method, we start from the dendrogram that represents our data. In the K-means method, we observe that the normalized data present better results, allowing the algorithm to train in a more efficient way. In this case, the data used also correspond to those normalized; Figure 10 shows the dendrogram formed with the data of the feature matrix of normalized characteristics. The dendrogram graph is a reference for determining the optimal number of clusters to create. A straightforward approach to selecting this number is employing a horizontal line as demonstrated in Figure A3. The count of vertical lines intersecting the horizontal line designates the number of clusters. While the figure distinctly illustrates two discernible groups, limiting the clusters to just two might result in the loss of valuable information. By analyzing the dendrogram's distribution, a strategic placement of the horizontal line  
Figure 8: Distribution of clusters resulting from the application of K-means in conjunction with PCA on detected spikes from (**a**) macaque monkey signals and (**b**) human pancreatic signals. Figure 9: A 3D distribution graph of clusters resulting from the application of K-means in conjunction with PCA on newly detected spikes from (**a**) macaque monkey signals and (**b**) human pancreatic signals. is established as exemplified in Figure 11. This choice yields a cluster count of six for both signals. In the case of detection conducted on the macaque monkey signal, the resultant grouping closely resembles that derived from the K-means approach. The distribution of the 327 spikes across these groups is enumerated in Table 7. Evidently, it becomes possible to discern the three distinct types of potentials depicted in Figure 6, notably spanning groups 3, 4, and 5. Nonetheless, the K-means method supplemented with PCA more accurately distinguishes the distant potentials. It achieves this by effectively minimizing confusion with noise. However, it is worth noting that while the hierarchical grouping method endeavors to isolate the distant potentials within a group, it still exhibits a degree of blending with noise. Nevertheless, despite this challenge, the outcomes attained through the hierarchical grouping method slightly surpass those derived from K-means without PCA, signifying incremental improvement. Similar observations extend to the clusters formed from the spikes within the human pancreatic signal, mirroring the findings. The detail of these clusters can be observed in Table 8.  
The data distribution and clusters for the spikes in the macaque monkey and human pancreatic signals are shown in Figure 12a,b. Figure 11: Selected clusters from the dendrograms for (**a**) macaque monkey data and (**b**) human pancreatic data. Where data detection at the bottom begins forming new groups based on distance similarity. Figure 10: Dendrograms with normalized data from (**a**) macaque monkey signal and (**b**) human pancreatic signal. Where data detection at the bottom begins forming new groups based on distance similarity.