Zeta Ae Math Journal Volume 10 No. May 2025, pp. E-ISSN: 2579-5864 P-ISSN: 2459-9948 D https://doi. org/10. 31102/zeta. Implementation of the K-Means Method for Beverage Clustering Based on Calorie and Protein Anggita Eka Rewina1. Rinci Kembang Hapsari1*. Chatarina Natassya Putri1. Gamaliel Virani Fofid Lande1. Andre Fransisco Aditya1. Mochamad Tegar Bagas Alamsyah1 Prodi Teknik Informatika. Fakultas Teknik Elektro dan Teknologi Informasi. Institut Teknologi Adhi Tama Surabaya. Surabaya. Indonesia *Corresponding AuthorAos Email: rincikembang@itats. ABSTRACT Recently, the number of coffee shops in big cities in Indonesia has increased. This makes it easier for coffee lovers to enjoy it. With the increasing public awareness of the importance of healthy drinking patterns in preventing diabetes and other diseases, consuming low-calorie drinks has become a prominent trend. This study aims to group the coffee drink menu at Starbucks based on the calorie and protein content of Starbucks It is grouped into 2 clusters, namely, high and low clusters. In this study, the clustering process of Starbucks drink menu data was carried out by applying the K-Means algorithm. The clustering results can identify members of Cluster 1 and members of Cluster 2. From the tests that have been carried out, it can group the drink menu into 2 clusters based on the amount of protein and calories from Starbucks drinks and help the public choose which drinks are better to consume. Keyword: Beverage content. Cluster. Clustering. K-Means. Article info: Submitted: November 21, 2024 Accepted: May 27, 2025 How to cite this article: Rewina. Hapsari. Putri. Lande. Aditya. , & Alamsyah. Implementation of the KMeans Method for Beverage Clustering Based on Calorie and Protein. Zeta - Math Journal, 10. , 19-29. https://doi. org/10. 31102/zeta. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution-ShareAlike 4. 0 International License. Anggita Eka Rewina, dkk. Implementation of the K-Means Method for Beverage Clustering Based on Calorie and Protein INTRODUCTION In this modern era, information about the nutritional content of food and beverage products is becoming increasingly important for consumers who care about health (Permana et al. , 2. Consumers pay attention not only to taste and price but also to their drinks' calorie and protein content. The development of innovation in the beverage industry, especially in drinks that contain high calories and protein, has increased significantly (Popkin et al. , 2. As one of the latest innovation drivers in the beverage industry. Starbucks provides coffee and is actively developing a variety of coffee-based and non-coffee drinks (Azriuddin et al. , 2. The brand's nutritional content is also inseparable from its high calories and protein. Calories and protein play essential roles in human nutrition. Calories are a combination of macronutrients derived from protein, carbohydrates, and fat, while protein is an energy producer of many amino acids (Aryadi et al. , 2. As the 3rd highest sweetener consumer in the world. Indonesia has a high demand for sweet drinks (Ferretti & Mariani, 2. The public needs to increase awareness of consuming these brands. Efforts to overcome this problem can utilize the clustering method using the K-Means algorithm. Previous studies have implemented the K-Mean method to identify essential performance factors that companies must demonstrate to meet consumer satisfaction (Arifin & Agustin, 2. Classification acts as a process of grouping objects, entities, or information based on characteristics of similarities or differences to facilitate understanding and analysis through the arrangement of more structured categories (Yaumi et al. The K-Means algorithm is an effective method for grouping data based on similar characteristics. KMeans works by dividing data into several groups . based on the closest distance to the cluster center . (Falakhi, 2. K-Mean method analysis is helpful in the business world, where business actors must think of ways to continue to survive and increase the scale of their business (Alvisan, 2. In its application. K-Means can also be used to group the nutritional status of toddlers (Nagari & Inayati, 2. Consumer segmentation is a crucial step in marketing strategy, where data mining plays an essential role in supporting this grouping process (Amborowati & Winarko, 2. The clustering method can cluster several data into clusters based on the level of similarity in one cluster and in another cluster, likewise at a high level of dissimilarity (Aryadi et al. , 2. The use of the K-Means algorithm is considered to be able to run data grouping that refers to several types of data distribution patterns/trends. therefore, the relationship between attributes is found between one another (Negara et al. The K-Mean method, used in conjunction with the elbow method, can provide optimal information in beverage clustering, resulting in a deeper understanding of consumer preferences for nutritional content in beverages (Yucha & Safitri, 2. Optimal clustering using the elbow method can help companies make more targeted decisions in product development and marketing strategies (Yaumi et al. , 2. The use of the K-Means algorithm is considered to have advantages in implementation and relatively fast processing time (Mursalim et al. , 2. The K-Means algorithm also has advantages in finding ideal clusters but has several shortcomings in determining the centroid point and k value, thus affecting suboptimal performance (Ariasa et al. , 2. To improve the performance of the K-Means algorithm, you can use the elbow method to get the optimal k value (Trianto et al. , 2. The K-Means algorithm can provide valuable information for consumers, the beverage industry, and related parties. Using the K-Means algorithm, drinks can be grouped based on their calorie and protein content so consumers can more easily choose drinks that suit their needs and preferences. Based on previous research, this study aims to obtain the results of grouping types of Starbucks drinks with high calorie and protein content. The K-Means algorithm was used as a grouping method, and the evaluation was done by applying the Elbow method to optimize the search for a good k value. Zeta Ae Math Journal. Vol. No. 1, pp. 19 - 29. May, 2025. LITERATURE REVIEW Data Mining Data mining is exploring and analyzing big data to find patterns, correlations, trends, and helpful information that can be used for decision-making. Data mining combines techniques from various disciplines, such as statistics, machine learning, and artificial intelligence, to analyze large and complex datasets (Zulfa et al. Data mining is a potent tool for uncovering hidden insights in data and supporting data-driven decisionmaking. With the advancement of technology and the increasing volume of available data, the ability to process and analyze data is becoming increasingly important. For organizations that can use it properly, data mining is not just about finding patterns in numbers but also opening the door to innovation and competitive advantage in an increasingly dynamic market. Pre-processing Data Data preprocessing is the first step before performing analysis or applying machine learning algorithms. This process includes a series of steps to clean, transform, and prepare data so that it is ready for use in more sophisticated analysis or prediction models. Without proper data preprocessing, the model built can produce poor or even misleading results. Data transformation is the process of changing raw data into a form that is more suitable or easier to analyze or process. It aims to improve data quality, reduce noise, or make the data more suitable for the model used. This transformation can take the form of changes to the data scale, data grouping, creating new features, or changing the data type to make it more compatible with a particular analysis or algorithm. One of the data transformation processes is data normalization. normalization is a method used to process data by creating several variables with the same range of values (Harmain et al. , 2. (Hapsari et al. , 2. This dramatically affects the results of processing because if there is a vast difference in the range of values between the other attributes, it will cause the attribute that has a larger value to have a powerful influence on the attribute that has a small value (Aziz et al. , 2. There are also methods for normalization, namely Z-score Normalization. Min-Max normalization, and Decimal Scaling Normalization (Ali, 2. The min-max normalization method standardizes the data on the samples taken so that each value in the calorie and protein variables has the same scale (Permana & Salisah. Min-max normalization is a technique by performing linear calculations on the original data to create a value proportion between other attributes (Mangku Negara et al. , 2. Clustering Clustering, or grouping, is a data analysis technique that aims to group objects or data points into groups . based on the similarity of their characteristics (Mulyana et al. , 2. Clustering is a handy tool in various disciplines, allowing the identification of hidden structures, patterns, and relationships in complex data sets (Nagari & Inayati, 2. In clustering, data is grouped into clusters based on maximizing intra-cluster similarity . ata in the same cluster have high similarit. and minimizing inter-cluster similarity . ata between clusters have significant In other words (Ashari et al. , 2. , objects in the same cluster should be very similar, while objects in different clusters should be very different (Revathi et al. , 2. Clustering allows a deeper understanding of the structure of the data and helps in better decision-making. Clustering is the process of grouping a set of data into similar groups. This process helps in understanding and finding natural group patterns in a dataset. Clustering algorithms have several categories based on features and mathematical modeling. One is centroid-based clustering using the K-Means algorithm (Uykan, 2. Implementation of the K-Means Method for Beverage Clustering Based on Calorie and Protein Anggita Eka Rewina, dkk. Clustering algorithms vary in their approaches and underlying assumptions, which affect the types of clusters found and their effectiveness on certain types of data. Hierarchical clustering methods build a hierarchical cluster hierarchy in stages while partitioning methods divide data into a predetermined number of clusters. Clustering is crucial in various real-world applications, including customer segmentation, document clustering, image analysis, and bioinformatics. In customer segmentation, clustering is used to identify distinct customer groups based on their purchasing behavior, demographics, or preferences. The success of clustering depends heavily on selecting relevant features, appropriate distance measures, and the right clustering algorithm (Falakhi, 2023. Yaumi et al. , 2. Evaluation of clustering results is also essential to ensure that the resulting clusters are meaningful and by the objectives of the analysis. METHODE In this research, four processes were carried out: dataset, data preprocessing, clustering, and system performance measurement. 1 Dataset The dataset used in this research is secondary data sourced from the official Starbucks website, where the data was obtained from the nutritional content information at Starbucks. The data amounts to 1380 based on the type of drink at Starbucks. In the dataset, there are variables energy . , fat . , of which saturated . , carbohydrates . , of which sugar . , fiber . , protein . , salt . , and caffeine . 2 Preprocessing Data At this stage, preprocessing performs two processes, namely sampling and normalization. Sampling is done using a random technique with the provisions of cup size and taking two attributes: calories and protein. In the second process, normalization is carried out. In this study, data normalization uses the Min-max Normalization method, with formula . X norm = X Oe X min ( Maxbaru Oe Minbaru ) Minbaru X max Oe X min . Where : X is the original value. Xmin is the minimum value of the data. Xmax is the maximum value of the data. Maxnew is the new maximum value . Minnew is the new minimum value . 3 K-Means The K-Means algorithm is a clustering technique built using the partition principle. This algorithm divides objects with the same level of similarity into the same cluster, while objects that do not have a high level of difference are placed in different clusters (Abid et al. , 2. (Bangkalang et al. , 2. The following is the process flow in the K-Means algorithm, according to (Mursalim et al. , 2. Zeta Ae Math Journal. Vol. No. 1, pp. 19 - 29. May, 2025. Prepare the dataset Determine the number of clusters . Initialize the center point . , which is determined randomly Calculate the distance of each data in the dataset to the centroid using the formula . yccycnyc = Oo. cuycn Oe ycuycayc ) . cycn Oe ycycayc ) . Where, dij is the distance of the i-th data with the j-th centroid xi is the attribute/parameter value x of the i-th data yi is the attribute/parameter value y of the i-th data xcj is the attribute/parameter value x of the j-th centroid ycj is the attribute/parameter value y of the j-th centroid Determine the group of each data into the nearest centroid Determine the new centroid value by calculating the average value of the cluster members Repeat the d-th process, if there is still data . luster member. that move clusters or if there is a change in the value of the centroid. 4 Performance Measurement Before implementing K-Means, the first thing to do is to get information on the number of the best k clusters using the elbow method. The purpose of this method is to determine a small k value that also has a low within The selection of the optimal number of clusters is done by observing the Sum Squared Error (SSE) value, which is the comparison of the calculation of the sum of the squares of the distance between the centroid and the cluster members between the number of clusters that will form an elbow at a point. The SSE value can be calculated using equation . ycIycIya = Ocya ya=1 Ocycuycn OOycIya Anycuycn Oe yayco An . Where. K is number of clusters xi is attribute value/parameter of the i-th data Ck is attribute value/parameter of the k-th centroid The more clusters k, the smaller the SSE value becomes. Where are The steps used in the elbow method as Provide/determine the initial K value Add/enlarge the K value Calculate the SSE value from the K value that has decreased drastically Determine the K value in the form of an elbow Implementation of the K-Means Method for Beverage Clustering Based on Calorie and Protein Anggita Eka Rewina, dkk. RESUT AND DISCUSSION The dataset used in this study is the nutritional information data contained in Starbucks drinks. It consists of 1380 data with 9 variables. From the 1380 data, 99 popular drink menu data were taken at Starbucks, and feature selection was carried out to determine the 2 attributes used, namely the Calories and Protein attributes. The data used are shown in Table 1. The data above is sample data selected based on the calorie and protein content of the Starbucks drink menu. This data determines whether the drink has a high or low content. Table 1. Calorie and Protein Content Dataset in Beverages Product Americano Caffe (C) Latte (L)- semi skimmed milk CL - whole milk CL - skimmed milk CL - almond drink CL - soya drink CL - oat drink CL - coconut drink Latte Macchiato - semi skimmed milk Latte Macchiato - whole milk Latte Macchiato - skimmed milk Latte Macchiato - coconut drink Cappuccino (Cp. - semi skimmed milk Cpc - whole milk Cpc - skimmed milk Cpc - almond drink Cpc - soya drink Cpc - oat drink Cpc- coconut drink Misto - semi skimmed milk Misto (M)- whole milk M - skimmed milk M - almond drink M - soya drink M - oat drink M - coconut drink Caramel (Cr. Macchiato (Mc. - whole milk Crm Mch - skimmed milk Crm Mch - almond drink Crm Mch - soya drink Crm Mch - oat drink Crm Mch - coconut drink Mocha - semi skimmed milk Mocha - whole milk Mocha - skimmed milk Mocha - almond drink Mch - soya drink Mch - oat drink Mocha - coconut drink White (W) Mch - semi skimmed milk W Mch - whole milk W Mch - skimmed milk W Mch - almond drink W Mch - soya drink W Mch - oat drink W Mch - coconut drink Calories Protein Zeta Ae Math Journal. Vol. No. 1, pp. 19 - 29. May, 2025. Product Cold (C) Brew (B) C B L - semi skimmed milk C B L - whole milk C B L - skimmed milk C B L - almond drink C B L - soya drink C B L - oat drink C B L - coconut drink Nitro (N) C B N Cpc Iced (I) Americano (A) I L - semi skimmed milk I L - whole milk I L - skimmed milk I L - almond drink I L - soya drink I L - oat drink I L - coconut drink Classic I Cappuccino - semi skimmed milk Classic I Cappuccino - whole milk Classic I Cappuccino - skimmed milk Classic I Cappuccino - almond drink Classic I Cappuccino - soya drink Classic I Cappuccino - oat drink Classic I Cappuccino - coconut drink I L Macchiato - semi skimmed milk I L Macchiato - whole milk I L Macchiato - skimmed milk I L Macchiato - almond drink I L Macchiato - soya drink I L Macchiato - oat drink I L Macchiato - coconut drink I Caramel Mch - semi skimmed milk I Caramel Mch - whole milk I Caramel Mch - skimmed milk I Caramel Mch - almond drink I Caramel Mch - soya drink I Caramel Mch - oat drink I Caramel Mch - coconut drink Iced Cappuccino with Cold Foam I Mocha (M. - semi skimmed milk I Mo - whole milk I Mo - skimmed milk I Mo - almond drink I Mo - soya drink I Mo - oat drink I Mo - coconut drink I White (W) Mo - semi skimmed milk I W Mo - whole milk I W Mo - skimmed milk Coffee FrappuccinoA - semi skimmed milk Coffee FrappuccinoA - whole milk Calories Protein The next step is to determine the most appropriate number of k clusters before running the clustering process. This study uses Jupyter, a tool for the Python programming language, to determine the number of clusters. The results are as follows. Implementation of the K-Means Method for Beverage Clustering Based on Calorie and Protein Anggita Eka Rewina, dkk. inert = [ ] k_range = range. for k in k_range: km = K_Means. _klaster=. _trai. The output of the program above produces a graph/diagram that shows the most ideal number of K clusters, therefore the next stage can be carried out, namely clustering using the K-Means algorithm. Figure 2. Elbow method graph Based on Figure 2, it can be seen that the number of K clusters produced based on the results of the elbow method calculation with the Python programming language is 2 clusters. Based on the results obtained, the average data on protein and calorie consumption will be clustered into 2 clusters, consisting of low and high clusters or K = 2. The clustering of two clusters is done so that it is known which drink values are in the low cluster and high cluster. The next stage is the clustering process using K-Means. Figure 3 shows a model of the K-Means clustering results produced with updated centroids. Zeta Ae Math Journal. Vol. No. 1, pp. 19 - 29. May, 2025. Figure 3. Results of the K-Means algorithm with new centroid results. Based on the last centroid value, which is the result of the previous process, 2 grouping clusters are generated based on the levels of average protein and calorie data. Figure 3 visualizes the cluster results formed from the K-Means algorithm. Figure 4 visualization of K-Means cluster results The results of cluster visualization are analyzed usingition of the cluster distribution data points in the KMeans cluster visualization results. If the distribution data points are getting closer to the left, with a value of 0, it can be concluded that the cluster is a group of drinks with a low-calorie level. Conversely, the calorie level is high if the distribution data points get closer to the right. CONCLUSION Referring to the research results that have been produced, namely to group Starbucks drinks based on protein and calorie nutritional content, it can be concluded that the K-Means algorithm forms a value of K = 2 clusters. So, the clustering of Starbucks drinks refers to the protein and calorie nutritional content divided into two categories, namely low and high. The results of the K-Means algorithm produced 2 clusters that refer to the protein and calorie nutritional content, namely cluster 1 and cluster 2. Anggita Eka Rewina, dkk. Implementation of the K-Means Method for Beverage Clustering Based on Calorie and Protein REFERENCE