# Combining Advanced Feature-Selection Methods to Uncover Atypical Energy-Consumption Patterns
## 2 Methodology
### Fuzzy Rough Feature-Selection Method
The positive region \(POS_{F}(Q)\) can be found using  
\[POS_{F}(Q)=\bigcup_{Y\in U/Q}FY\]  
where \(FY\) are the rough sets of lower approximations, defined as  
\[FY=\{u_{i}\in U\mid[u_{i}]_{U/IND(F)}\subseteq Y\}.\]  
If the goal is to identify the largest positive region for a specific number of features, denoted as \(k\), the FRFS algorithm calculates the \(POS_{F}(Q)\) for each set of \(k\) features and selects the set that maximizes it. This means it chooses the set with the highest number of \(u_{i}\). Alternatively, if we want to consider all possible combinations of features, from \(n=1\) to \(n=n\), FRFS will give us the smallest number of features that maximize \(POS_{F}(Q)\). The fuzzy rough nearest neighbor (FRNN) classification method can handle fuzzy and uncertain data. It extends the nearest neighbor classification concept by classifying test objects based on their similarity to a specified number of neighbors, denoted by \(K\). The method considers the membership degrees of these neighbors to the class labels when assigning a class label to the test object [35]. The FRNN algorithm computes the distances \(\|y-u_{j}\|\) between an unclassified object \(y\) from the testing data and each object \(u_{j}\) from the training data. After calculating these distances, FRNN considers the fuzzy memberships of the \(k\) nearest neighbors to determine the fuzzy membership of \(y\) to each class \(c\). The aggregation process combines the fuzzy memberships of the neighbors to determine the fuzzy membership of the test object. The membership degree of a given new sample \(y\) in a class \(c\), represented by the \(k\) nearest neighbors, is measured as  
\[\mu_{c}(y)=\frac{\sum\limits_{j=1}^{k}\mu_{Gj}\bigg{(}\frac{1}{\|y-u_{j}\|^{2 ^{(q-1)}}}\bigg{)}}{\sum\limits_{j=1}^{k}\bigg{(}\frac{1}{\|y-u_{j}\|^{2^{(q-1)} }}\bigg{)}},\]  
where \(q\in(1,+\infty)\) is the fuzzy strength parameter and \(\mu_{cj}\) is the membership of the sample \(u_{j}\) from the training data to the class \(c\) among the \(k\) nearest neighbors. To classify the test data point \(y\), we select the class \(c\) with the highest fuzzy membership value \(\mu_{c}(y)\). Subsequently, we compare the predicted class labels (associated with fuzzy memberships) to the true class labels (i.e., the original class of the test data point). The accuracy is calculated by determining the correctness of predictions for each data point \(y\). The algorithm for the FRFS is presented in Algorithm 3. ```
0: Dataset \(D\) with features \(F=\{f_{1},f_{2},\ldots,f_{n}\}\), target variable \(Y\)
0: Selected feature subset \(F_{s}\)
1: Initialize: \(F_{s}\leftarrow\emptyset\)
2: Calculate initial positive region \(POS_{F}(Q)\) for all features \(F\)
3:while\(|F_{s}|<n\)do
4:for each feature \(f_{i}\in F\setminus F_{s}\)do
5: Compute the positive region for feature \(f_{i}\)
6:endfor
7: Find the feature \(f^{*}\) that maximizes the positive region
8: Add \(f^{*}\) to \(F_{s}\)
9: Update the positive region \(POS_{F_{s}}(Q)\)
10:if\(POS_{F_{s}}(Q)\) equals \(POS_{F}(Q)\)then
11:break
12:endif
13:endwhile
14:return\(F_{s}\)
```  
**Algorithm 3** Fuzzy Rough Feature Selection (FRFS)