# Determining the Quality of a Dataset in Clustering Terms
## 1 Introduction  
Customer segmentation is the process of dividing the entire market into smaller customer groups. It enables one to understand the different customers' needs and behaviours and adapt the appropriate marketing approach or product recommendations to them [1; 2; 3; 4]. Since in most cases, we do not know in advance what group a given customer belongs to, we are dealing here mainly with unsupervised learning. The datasets whose clustering quality we determine do not have specified labels based on which we could test the accuracy of the prediction. We need to focus on methods that do not require the number of clusters or use metrics that allow us to determine the optimal number of clusters. Because our methodology does not use supervised learning, it would be easier to apply in practice, where most use cases are those of unsupervised learning. Clustering is one of the most common tasks in the field of unsupervised learning. It is a technique for grouping objects into clusters. Objects with the most similarities remain in a group and have less or no similarities with another group's objects. Clustering mainly deals with finding a structure or pattern in a collection of uncategorised data. For the purposes given above, this paper focuses on unsupervised clustering, meaning no fixed number of groups. For such clustering, the hierarchical algorithms are very widely used. Such algorithms are intuitive and easy to implement, hence their popularity. To determine the number of clusters, one would have to take a look at the obtained dendrogram. One of our goals is to overcome the limitations of hierarchical clustering [5], namely, that they do not work well on vast quantities of data, they have difficulties with handling clusters of different sizes, they focus mostly on breaking into large clusters, the order of the data has an impact on the final results, and, most importantly, they are sensitive to noise and outliers. Because of all those drawbacks, we decided to restrain from using hierarchical clustering and instead focused on graph methods and the spatial DBSCAN algorithm which, in its definition, was built to deal with noise and outliers. Our motivation was also to tackle the problem of mixed datasets, meaning datasets containing both numerical and categorical variables. For the latter, the computation of the similarity or distance between observations is impossible, because they are not in numerical forms. Basic methods of dealing with categorical variables include one-hot encoding or label encoding. However, label encoding is more suitable for ordered categorical data, and one-hot encoding has the disadvantages of generating high-dimensional data and disregarding eventual similarities between the levels of a variable. We intend to cope with the problem of categorical values by creating meaningful embeddings for them, where by embedding, we mean dense numerical vectors. Currently, the embeddings are mostly computed by the use of neural networks. However, neural embeddings are used in supervised tasks, and they need a target variable to check if the embeddings are correct. The idea to remove the need for en explicit target variable is to use an autoencoder model, which computes a loss by comparing the reconstruction from a model with the original input data. The modern methodology that we present contains a modification of the recent AutoEmbedder model [6]. Many articles have been dedicated to the concept of customer segmentation. The majority are classical statistical clustering methods, with the most common method, \(k\)-means, at the forefront. However, there are also other methods such as conjoint analysis [7], random forests [8], principal component analysis (PCA) [9], logistic regression [10] or even artificial neural networks [11]. For an extensive overview of the methods, see [12; 13]. Section 2 of the article describes the datasets examined, followed by a detailed presentation of the methods used.