## 4 Discussion  
The comprehensive exploration of clustering methods within the context of spike sorting in both macaque monkey and human pancreatic signals has yielded valuable insights into the intricacies of neural signal analysis. The amalgamation of advanced computational techniques with the distinct characteristics of neural recordings underscores the multi-faceted nature of this endeavor.  
The initial step of spike detection formed the foundation for subsequent analysis. The application of an adaptive threshold, as described, facilitated the automatic identification of action potentials while efficiently adapting to background noise levels. Notably, this strategy allowed us to focus on the nuanced shapes and patterns of the detected spikes without being encumbered by noise artifacts.  
Feature extraction emerged as an intermediate stage, enhancing the interpretability of the data while reducing their dimensionality. The utilization of Principal Component Analysis (PCA) for signal dimensionality reduction effectively captured essential information in both signals. This reduction in dimensionality proved beneficial for subsequent clustering algorithms, enabling more effective differentiation among distinct spike shapes. In the context of the macaque monkey signal, this approach enabled the identification of a cluster of spikes that were initially misinterpreted as noise due to their similar signal  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Group** & **Spike Shape** & **Number of Spikes** \\ \hline
1 & & 61 \\
2 & & 105 \\
3 & & 25 \\
4 & & 41 \\
5 & & 56 \\
6 & & 56 \\ \hline \hline \end{tabular}
\end{table}
Table 10: Groups formed with Self-Organizing Maps (Human pancreatic data).  
amplitude. In the scenario of the human pancreatic signal, the combined utilization of PCA and K-means led to enhanced classification outcomes. Specifically, it transformed a scenario with only two distinct groups achieved through K-means alone into one featuring three well-defined groups, underscoring the complementary power of these methods when employed together.  
The integration of Self-Organizing Maps (SOM) introduced a novel dimension to the study. The SOM methodology offered an unsupervised learning framework that revealed underlying data topology. The resulting clusters enabled the identification of similar neural patterns, thereby contributing to a refined understanding of neural activity. The delineation of clusters as showcased through density graphs and distance measurements provided a visual representation of the spatial distribution of these neural patterns.  
The hierarchical clustering approach further refined the clustering process, allowing for the formation of cohesive groups based on the proximity of nodes. This hierarchical arrangement effectively organized the neural patterns into clusters that aligned with their inherent similarities. The discernment of optimal group numbers through dendrogram analysis attested to the efficacy of this approach in capturing meaningful clusters while avoiding over-segmentation. The results of this method are similar to those obtained jointly by PCA and K-means. This indicates that the intermediate use of PCA can be omitted if we focus on hierarchical clustering.  
A comparison of the results achieved through different methods unveils noteworthy findings. The identification of the six types of potentials demonstrates the ability of the proposed approach to disentangle complex neural patterns. Furthermore, the resemblance of the results to the K-means method augmented with PCA in the identification of distant potentials underscores the robustness of the methodology.