## 2 Background
### Clustering Algorithms and Evaluation  
To find clusters of common charging behavior, three popular clustering algorithms were utilized, namely k-means, hierarchical, and gaussian mixture model (GMM). These clustering algorithms are widely used in clustering applications related to charging behavior in the existing literature [16]. Furthermore, for the limited dataset size, more complex deep learning-based clustering solutions were not appropriate.  
In k-means clustering, the data points are initially assigned randomly to k-centroid points, as described in Algorithm 1. \(K\) is defined as the number of clusters. The elbow method is usually utilized to define the number of clusters [25]. The data points are then iteratively assigned to new centroids based on their similarity using Equation (1). Meanwhile, the centroids are computed and every iteration is updated based on Equation (2). The process is repeated until the algorithm converges and the cluster labels do not change any further.  
```
Initialize the cluster centroids \(\mu_{1},\mu_{2},\ldots,\mu_{k}\in\mathbb{R}^{n}\) randomly FOR Each cluster \(C_{j}\) Repeat until convergence: Cluster points based on distance from centroid: \[c^{(i)}:=arg\;min\limits_{j}\left\|\;x^{(i)}-\mu_{i}\;\right\|^{2}\] (1) Compute and update new centroids for each cluster: \[\mu_{i}:=\frac{\sum_{i=1}^{n}1\{c_{(i)=j}\}x^{(i)}}{\sum_{i=1}^{n}1\{c_{(i)= j}\}}\] (2) END
```  
**Algorithm 1**K-Means Clustering  
Hierarchical clustering used in the agglomerative variation results in the clustering occurring in a bottom-up approach. Each item starts off as an individual cluster and is then merged as one moves up the hierarchy [26]. Gaussian mixture model was also used to cluster the common charging behavior. In this approach, probabilistic learning takes place that can represent normally distributed subpopulations by considering multiple normal distributions of the dataset [16].  
Internal validation was utilized to quantify the performance of clustering since no ground truth was available. Three internal validation metrics namely Silhouette index, Davies-Bouldin index, and Calinski-Harabasz index were used. For a given cluster, \(X_{j}(j=1,\ldots c)\), the silhouette index is defined in Equation (3) [27]:  
\[s(i)=\frac{(y(i)-z(i))}{\text{Max}\{y(i),z(i)\}} \tag{3}\]  
where \(y(i)\) is the average distance between the \(i\)th sample and all of the samples included in \(X_{j}\), and \(z(i)\) is the minimum average distance between the \(i\)th sample and all of the samples clustered in \(X_{k}(k=1,\ldots c;\)\(k\
eq j)\). The objective in the Davies-Bouldin index, defined in Equation (4), is to identify sets of clusters that are closely packed but separated well from other clusters [27].  
\[Davies-Bouldin=\frac{1}{c}\sum_{i=1}^{c}\text{Max}_{i\
eq j}\left\{\frac{z(X_{ i})+z\big{(}X_{j}\big{)}}{d\big{(}c_{i},c_{j}\big{)}}\right\} \tag{4}\]  
where \(c\) denotes the number of clusters, \(i\),\(j\) are cluster labels. Samples in clusters \(i\) and \(j\) to their respective cluster centroids are defined by \(z(X_{i})\;z\big{(}X_{j}\big{)}\;\) and \(d\big{(}c_{i},c_{j}\big{)}\) is the distance between the centroids. Finally, the Calinski-Harabasz index is defined by Equation (5):  
\[Calinski-Harabasz=\frac{\text{trace}(S_{B})}{\text{trace}(S_{I})}\cdot\frac{n_{ s}-1}{n_{s}-c} \tag{5}\]  
where \(c\) denotes the number of clusters, \(n_{s}\) denotes the number of clustered samples, \(S_{B}\) defines the between-cluster scatter matrix, and \(S_{I}\) defines the internal scatter matrix.