## 3 The Closest Resemblance Algorithm
### Phase 2: Classification Phase
\[R^{s}_{j}(p(C^{h}),p(C^{l}))=\begin{cases}1&if\quad d^{s}_{j}(p(C^{h}))\leqslant d ^{s}_{j}(p(C^  
\(w_{j}\), we determine for each pair of prototypes \((p(C^{h}),p(C^{l}))\) the global outranking index \(R^{s}(p(C^{h}),p(C^{l}))\), which is determined by Equation (6).  
\[R^{s}(p(C^{h}),p(C^{l}))=\sum_{j=1}^{n}(w_{j}\times R^{s}_{j}(p(C^{l}),p(C^{l})) ),h,l=1,\ldots,K;j=1,\ldots,n. \tag{6}\]  
\(R^{s}(p(C^{h}),p(C^{l}))\) translates the degree to which the resemblance between the data point \(s\) and the prototype \(p(C^{h})\) of class \(C^{h}\) is stronger than the resemblance between the data point \(s\) and the prototype \(p(C^{l})\) of class \(C^{l}\). The \(CR\) classifier is based on a scoring function from an outranking relation \(R^{s}\) to choose the best prototype in terms of its resemblance to the data point \(s\). Based on the outranking relation \(R^{s}\) between the prototypes of classes, \(CR\) selects the best prototype in terms of its resemblance with the data point to be classified. The scoring function is used to select a prototype that more closely resembles data point \(s\). The scoring function is inspired from the scoring function used by the multicriteria decision-analysis method PROMETHEE [37]. It allows for calculation of the degree to which a prototype of a class is preferred to all other prototypes, and inversely, how others are preferred to it. This is defined by calculating the globally positive outranking flow given by Equation (7) and negative outranking flow given by Equation (8). \[\phi^{+}(p(C^{h}))=\sum_{l=1,l\
eq h}^{K}R^{s}(p(C^{h}),p(C^{l})) \tag{7}\]  
\[\phi^{-}(p(C^{h}))=\sum_{l=1,l\
eq h}^{K}R^{s}(p(C^{l}),p(C^{h})) \tag{8}\]  
The positive outranking flow \(\phi^{+}\) defines the strength of the prototype \(p(C^{h})\) regarding its resemblance to the data point \(s\). The negative flow \(\phi^{-}\) defines the weakness of the prototype \(p(C^{h})\) regrading its resemblance to the data point \(s\). From these two flows, determined in Equations (7) and (8), the net flow \(\phi\) can be calculated by Equation (9). \[\phi(p(C^{h}))=\phi^{+}(p(C^{h}))-\phi^{-}(p(C^{h})) \tag{9}\]  
The net flow \(\phi\) is the score of the prototype \(p(C^{h})\) according to the outranking relation \(R^{s}\). The highest value of \(\phi\) represents the best prototype regarding its resemblance to data point \(s\), which means that the class \(C^{h}\) is the best candidate for the data point \(s\). Hence, the \(CR\) classifies the unlabeled data point \(s\) by the following decision rule given by Equation (10). \[s\in C^{h}\Leftrightarrow\phi(p(C^{h}))=\max_{l\in\{1,\ldots,K\}}\left\{\phi( p(C^{l}))\right\} \tag{10}\]  
The classification procedure used by \(CR\) to classify data into the preferred classes is summarized by Algorithm 2. The general framework of our proposed \(CR\) classifier is presented in Figure 3, with the following steps. * **Step 1--data splitting:** Divide the dataset into 5 equal folds. * **Step 2--iteration loop:*
* Iterate through folds. For each iteration, perform the following: 1. Select one fold as the testing set; 2. Combine remaining folds as the training set. * _Phase 1--training phase:_ Combine the 4 folds to form the training set. * _Class division:_ Divide the training set into classes based on the target variable. * _Feature interval calculation_: For each class and feature, calculate intervals based on the mean and standard deviation or on percentiles. Determine low and high boundaries for each interval. * _Prototype creation_: Define prototypes for each class using the calculated intervals. * _Phase 2: Testing phase:_ For each test sample in the testing fold perform the following:
* Partial distance calculation: Calculate the partial distance of the testing sample and the prototype of each feature. * Partial resemblance calculation: Calculate the partial resemblance between each feature's test sample and the prototypes of different classes. * Weighted resemblance: Calculate the weighted resemblance matrix for each test sample and prototype of a class.