# Enhancing IoT Network Security Using Feature Selection for Intrusion Detection Systems
## 3 Materials and Methods
### Feature Selection  
Deriving valuable information from large-scale datasets is a topic of special interest in machine learning and data mining [29]. Feature selection is conducted to select an appropriate set of features and eliminate the irrelevant features from a dataset [16]. Minimizing the number of features enables effective data analysis [30]. For several tasks, such as clustering, classification, regression, and generating association rules, the usage  
Figure 1: The proposed feature selection methodology. of all features is not recommended. The number of features must be minimized because some act as noise and increase data redundancy. The selection of appropriate features reduces data dimensionality, decreases computational costs, and improves the performance of classification [31]. Feature selection techniques designed with different evaluation criteria are broadly divided into three categories: filter, wrapper, and embedded models. In filter-based methods, which were mainly used in this study, features are chosen based on statistical measures [31]. This technique does not rely on learning induction methods and instead selects the features in a preprocessing phase. In addition, filter-based methods have relatively low complexity and offer satisfactory stability and scalability [32]. Meanwhile, wrapper methods assess the performance of various combinations of input features to find the best combination for the model. This method is computationally expensive but achieves high accuracy [20]. Moreover, embedded feature selection methods have built-in mechanisms for choosing the most important features as part of the learning process [20]. Various filter-based methods, specifically CFS, information gain, the gain ratio, Pearson's analysis, and symmetrical uncertainty, were applied in the present study. Information gain is an entropy-based feature selection technique commonly used in the field of machine learning. It refers to how much information a variable provides about the target class, thereby revealing the most informative features. Features with high information gain are significantly relevant to the target class and are generally selected to obtain the best classification results. Nevertheless, determining the information gain does not eliminate any redundant features. Therefore, a filter is also needed. Information gain is derived from entropy, which is used to measure the ambiguity of a class by measuring the probability of a certain feature. The maximum value of the information gain for multiple classes is 1 [33]. The gain ratio is a non-symmetrical measure that modifies the information gain to decrease its bias. The gain ratio accounts for the number and size of branches when selecting a feature and adjusts the information gain by considering the intrinsic information of a split. Intrinsic information is considered to be the entropy of the distribution of instances, divided into branches. The feature values decrease as the intrinsic information becomes larger [34]. CFS is a feature selection method that chooses subsets of variables that can provide the highest amount of information about the target class while decreasing redundancy with other features. The CFS technique first measures the correlation between each variable and the target class. Next, it calculates the correlation between each set of features. Finally, it picks the subset of features that has the maximum correlation with the target class and the lowest correlation with the other features [35]. The Pearson correlation coefficient is generally used to identify the degree of linear correlation between two features, which can help to eliminate features. Consequently, when two variables have a high correlation, one of them can be dropped. Features with high correlation values are considered redundant; thus, only the features with minimum redundancy are selected. The features with lower values are added to the selected feature set [36].