## 2 Method  
A novel methodology was designed, developed, and executed to investigate and validate the innovative approach outlined in the previous section. The accompanying pseudocode delineates the method's procedural implementation. The list below provides some definitions and notations. * Dataset D contains n observations, \(x_{i}\), \(i=1,\ldots,n\) and \(d\) features, i.e., \(x_{i}\in R^{d}\). * For each feature \(f_{j}\), denote its mean by \(\overline{f_{j}}\), \(j=1,\ldots,d\), and let \(\overline{f}=\left(\overline{f_{1}},\ldots,\overline{f_{d}}\right)\). Define \(E=\sum\limits_{j=1}^{d}\left\|x^{(j)}-\overline{f_{j}}\right\|^{2}=\sum \limits_{j=1}^{d}\sum\limits_{i=1}^{n}\left(x^{(j)}_{i}-\overline{f_{j}} \right)^{2}\), where \(x^{(j)}_{i}\) is the value of feature \(j\) in observation \(i\), and \(x^{(j)}=\left(x^{(j)}_{1},x^{(j)}_{2},\ldots,x^{(j)}_{n}\right)\), \(j=1,\ldots,d\). Note that \(E\) is the sum of squared distances from the mean values of the features. * In the context of the K-means algorithm, we denote cluster k by \(C_{k}\) and its centroid by \(c_{k}\in R^{d}\), for \(k=1,\ldots,K\). The total K-means cost is given by \(SSE=\sum\limits_{k=1}^{K}\sum\limits_{i:x_{i}\in C_{k}}\left\|x_{i}-c_{k} \right\|^{2}\). * Examples of the stopping conditions set by the user are the following: 1. d*--maximum number of features that can be reduced from D. 2. A*--maximum percentage of accuracy reduction relative to the accuracy achieved when utilizing all features. Accuracy can be assessed through various components derived from a confusion matrix, such as precision, recall, or F1 score. 3. Users have the flexibility to incorporate and define additional stopping conditions The algorithm includes the following steps: 1. Load dataset D (an unsupervised dataset, i.e., no target variable) 2. Normalize dataset D (via MinMaxScaler using Sklearn) 3. Calculate E. 4. Determine the optimal number of clusters (K) for dataset D utilizing the Elbow and Silhouette methods 5. Calculate K-means performance measures, such as the total cost SSE, silhouette, centroid vectors, cluster members, etc. Based on the outcomes yielded by the K-means algorithm, create a new feature within dataset D to signify clusters, and allocate to each observation its respective cluster value [44]. This action shifts the problem from the domain of unsupervised learning to that of supervised learning. 7. Split the dataset D into a training set and a test set and perform the KNN algorithm with k = 5 (note: future research can use, examine, modify, and adjust different values of k). That is, assign each observation in the test set to a class according to the class of its 5 nearest observations from the training set. Also, perform RF (Random Forest) with n_estimators = 25. Note that the test and train sets are split up the same way, with the same random seed the entire process. 8. Compute the corresponding confusion matrix measures (accuracy, precision, recall, and F1) derived from the KNN and Random Forest. 9. For each feature j, compute its importance level, defined by \(IMP_{j}=\frac{\left\|x^{(j)}-\overline{j}\right\|^{2}}{E}\), and order all importance levels from low to high. 10. While the stopping criteria = FALSE, do: 1. Remove feature m from D if \(IMP_{m}=\underset{j}{\text{min}}IMP_{j}\), that is, remove the feature with the lowest importance level. 2. Perform the K-means algorithm on the new dataset (with one less feature) with the same K derived from the Elbow and Silhouette methods (step 5) and calculate the relevant performance measures mentioned in step 5. 3. Run steps 6, 7, 8, and 9. Calculate the percentage reduction in accuracy relative to the accuracy achieved when utilizing all features' new accuracy. 11.