# Real-Time Evaluation of the Improved Eagle Strategy Model in the Internet of Things
## 3 Improved Eagle Strategy
### Calculate the Service Based on Method Names  
The second set of activities involved clustering or grouping the services into categories according to the names of their methods. The clustering method was used to narrow the search space to make the process of choosing a service more manageable. That is done to the advantage of the benefits offered by the traditional ES. The proposed method could select the service in less time than it would have taken using a more prominent search space because it narrowed the search. Clustering is the process of grouping data into groups based on their similarity. According to [PERSON], [PERSON], & [PERSON] (2016), the primary objective of clustering is to classify similar kinds of data into the same cluster when those data types are comparable in terms of precise metric similarities [30; 31]. The K-Means algorithm significantly emphasized the value of distance to determine the length from one WS to another. According to the research in [32], Manhattan distance results are superior to Minkowski and Euclidean distances. The amount of space that separates two points, as measured by the Manhattan distance function, is equal to the sum of the absolute differences in their Cartesian coordinates. It is usually determined by adding the x-coordinate difference to the y-coordinate difference and subtracting it from 100. Accordingly, the Manhattan distance, denoted by \(\text{d}(x,y)\), can be defined in the following way [32; 33]. The algorithm for calculating the Manhattan distance is shown in Table 2 below. \[(x,y)=\sum_{i=1}^{k}|x_{1}-y_{1}| \tag{4}\]Clustering generally analyses and categorizes available data based on criteria, with the same samples in one category finding the most differences with samples in other types. Clustering is typically considered an unsupervised method because connection and subsequent grouping are examined without prior knowledge of the class label patterns. WS clustering is all about selecting and extracting the features of WS and discovering the commonalities between them to construct groups or classes based on those qualities [32]. The K-means clustering method is one of the most extensively used algorithms for clustering implementation. That is primarily attributable to its performing exceptionally well for large datasets [33; 34]. The K-means clustering method is one of the most popular algorithms for clustering [32]. K-means is a method that measures the distance between each point in a dataset and the centroids of clusters to locate data objects that are similar to one another and assign them to the cluster that is closest to them. The K-Means algorithm is based on the idea that k clusters are generated in such a way that the centroids of their clusters are closer than the centroids of other clusters. The algorithm's operation begins with choosing k points as the centroids. After choosing the k points, all points are assigned to the nearest centroid, forming k clusters. After that, a centroid is calculated by taking the average of each cluster's points. The mean vector comprises these centroids, each vector field equaling a cluster centroid. Finally, the new centroid creates additional clusters due to this process. The process will be completed if the centroids do not change. The proposed method used the K-Means clustering technique to achieve its desired results [35]. The Python programming language is used to determine the K value. According to the findings of [31], text-based clustering methods such as K-Means produce better results regarding both accuracy and F-measure. F-Measure, also known as F-Score, is a metric used to evaluate the quality of clustering results. It measures the clustering's accuracy, combining Precision (_PC_) and Recall (_RE_) into a single metric. Precision measures how many of the items assigned to a cluster are members of that cluster. Recall measures how many of the things that belong to a cluster are correctly assigned to that cluster. The F-measure ranges between 0 and 1, with 1 indicating perfect clustering results.