Skip to main content
. 2022 Apr 21;22(9):3199. doi: 10.3390/s22093199
Algorithm 1 Feature selection.
Input: Original features Φ, input data {(X1,y1),,(XN,yN)}
Output: Selected features Φ
  1: Initialize thresholds r1, r2
  2: Initialize number of repeats T
  3: for f in Φ do
  4:     Compute actual Gini importance I{f} from {(X1,y1),,(XN,yN)} according to Equation (1)
  5: end for
  6: for i=1T do
  7:     Shuffle the labels y1,,yN, which is referred to as y1,,yN
  8:     for f in Φ do
  9:         Compute new Gini importance of D{f}i from {(X1,y1),,(XN,yN)} according to Equation (1)
10:     end for
11: end for
12: for f in Φ do
13:     Compute score of the feature according to Equation (4), which is referred to as S{f}
14: end for
15: Select the features with a score lower than r1, which is referred to as Φ1
16: Delete the features Φ1 from Φ
17: Compute the correlation matrix of features Σ according to Equation (5)
18: Select the features with less actual Gini importance in each pair of features with a correlation above r2 which is referred to as Φ2
19: Delete the features Φ2 from Φ
20: Obtain the remaining features in Φ, which is referred to as selected features Φ