## 2 Materials and Methods
### Unsupervised Classification Methods  
Three distinct methods were employed to classify the identified spikes for both signals: K-means, hierarchical clustering, and Self-Organizing Maps (SOMs). The protocol and parameters used during experiments are depicted in Figure 3. In this work, we chose to avoid using features incurring high computational costs. Therefore, we only utilized time-domain statistics as features. Below are the features utilized during the experiments:  
* Mean Absolute Value (_MAV_). It is the average of the absolute values of the \(N\) samples taken: \[MAV=\frac{1}{N}\sum_{i=1}^{N}|s(i)|\] (2)
* Variance (_VAR_). It defines the dispersion of the data with respect to the mean: \[VAR=\frac{1}{N-1}\sum_{i=1}^{N}(x_{i}-\bar{x})^{2}\] (3)
* Root Mean Square (_RMS_) is a scalar value corresponding to the root mean square. It is used to help obtain the amplitude of the signal: \[RMS=\sqrt{\frac{1}{N}\sum_{i=1}^{N}x_{i}^{2}}\] (4)
* The Integral of the Absolute Value (_IAV_). It represents the sum of the absolute values of the signal in a period of time: \[IAV=\sum_{i=1}^{N}|x_{i}|\] (5)
* Simple Square Integral (_SSI_). It calculates the energy of the signal: \[SSI=\sum_{i=0}^{N}|x_{i}^{2}|\] (6) Waveform Length (_WL_). It specifies the cumulative length of the waveform shape in a particular segment: \[WL=\sum_{i=1}^{N-1}|x_{i+1}-x_{i}|\] (7)  
\begin{table}
\begin{tabular}{l c c c c} \hline \hline  & **Average Deviation** & **Variance** & **Wavelength** & **RMS** \\ \hline
0 & \(-0.625955\) & \(-0.556876\) & \(-0.512561\) & \(-0.574781\) \\
1 & \(-0.643811\) & \(-0.578161\) & \(-0.856704\) & \(-0.641413\) \\
2 & \(1.92222\) & \(2.23712\) & \(1.76218\) & \(2.07959\) \\
3 & \(1.72554\) & \(1.86247\) & \(1.81155\) & \(1.87429\) \\
4 & \(-0.207561\) & \(-0.403196\) & \(0.215127\) & \(-0.250521\) \\
5 & \(-0.689361\) & \(-0.589357\) & \(-0.879274\) & \(-0.674468\) \\
6 & \(-0.468224\) & \(-0.508807\) & \(0.36071\) & \(-0.464447\) \\
7 & \(1.92925\) & \(2.01965\) & \(1.38249\) & \(1.95593\) \\
8 & \(1.92223\) & \(1.88622\) & \(1.43699\) & \(1.87117\) \\
9 & \(2.01004\) & \(2.13762\) & \(1.93265\) & \(2.02572\) \\
10 & \(-0.629296\) & \(-0.574017\) & \(-0.682783\) & \(-0.629894\) \\
11 & \(-0.678137\) & \(-0.588473\) & \(-0.756864\) & \(-0.666986\) \\
12 & \(0.800711\) & \(0.448739\) & \(0.658404\) & \(0.799653\) \\ \hline \hline \end{tabular}
\end{table}
Table 3: Feature matrix for a subset of 12 detected spikes in the human pancreatic signal with normalization.  
* Entropy (\(H\)). Entropy measures the complexity of an uncertain system. It is a statistical method for quantifying the unpredictability of variations in both deterministic and stochastic signals: \[H=-\sum_{i=1}^{N}p_{i}ln(p_{i})\] (8) where \(p_{i}\) is the corresponding probability of each of the \(N\)-states.  
To enhance the differentiation between action potentials, additional features based on their waveform characteristics were calculated. These features included the zero-crossing rate (the number of times the waveform crosses zero), the peak-to-peak distance (the distance between samples at the minimum and maximum peaks), and the peak amplitude. This focus on waveform properties aimed to improve the ability to distinguish between action potentials. The following sections delineate the outcomes attained through the application of these methodologies.