# Cluster-Based Approaches toward Developing a Customer
## 3 Materials and Methods
### K-Means Clustering Technique  
Clustering is the process of grouping a set of observations into groups of similar behaviors [23]. A cluster is a set of observations that are similar to each other within the same cluster and different from observations in another cluster. K-means clustering is a simple and popular approach to segmenting a dataset into K distinct clusters, where K is the number of clusters. To perform k-means clustering, the desired number of clusters must be specified, and each observation must be assigned to exactly one of the clusters. The calculation process of the k-means clustering technique is detailed succinctly below.  
* **Step 1:** Aiming to find good centroids that represent unique information about the characteristics reported in the dataset, the algorithm starts with an initial estimate of the centroids and alternately determines clusters from the centroid and the centroids from the means of the clusters.
* **Step 2:** Iterate until the cluster assignments stop changing.
* For each of the K clusters, calculate the centroids of the cluster.
* Assign each observation to the cluster whose centroid is closest. In this study, the closest is defined via Euclidean distance.  
[PERSON] et al. [24] describe the calculation of the k-means algorithm in their study aiming to create customer segments in the energy industry. [PERSON] et al. [25] not only corroborate the calculation of the same clustering technique but also explain how to determine customer loyalty based on classification after clustering.  
\begin{table}
\begin{tabular}{c c c} \hline \hline
**Attributes** & **Type** & **Description** \\ \hline Customer ID & Categorical & Unique identification of the customer. \\ \hline Gross revenue & Numeric & Monetary value spent by the customer since the start of their active life in the company. \\ \hline Frequency & Integer & Number of times the customer has expanded the services initially contracted. \\ \hline Recency & Integer & Time in days since the last expansion made by the customer. \\ \hline Business & Integer & Binary identification of the contractual segmentation of the customer, where 1 represents service establishments and 0 private establishments. \\ \hline Direct debit & Integer & Binary identification of the segmentation of the method of payment made by the customer, where 1 represents customers who make payment by direct debit and 0 other forms of payment. \\ \hline Time to first & Integer & Time in days from the installation date to the first expansion of initially contracted services. \\ \hline Quantity of debt & Integer & Number of times the customer was managed by the debt department. \\ \hline North region & Integer & Binary identification of the region in which customers are located, where 1 represents customers who have an installation in the northern region and 0 represents customers in the southern region of the country. \\ \hline \hline \end{tabular}
\end{table}
Table 7: Features created based on the voting results of the most important characteristics applied in the questionnaire with the main business managers (source: the authors).