Skip to main content
. 2017 Dec 26;23(1):52. doi: 10.3390/molecules23010052
Algorithm 2 M-SVM-RFE-OA
Input: training dataset X, t.
Output: selected feature subset FS.
Begin
  c_acc = 0;
  c_oa = ∞;
  F = {all input features};
  While (|F| > 0) Do
   Calculate Nr(x) for each xX based on F;
   Xt = X;
   For each cC Do
    Xc = {x | xX, Label(x) = c and Nr(x) > 0};
    θ = |{x | xX, Label(x) = c}|;
    If |Xc| > θ/3 Then
     Rank the samples in Xc based on Nr(x) in descending order;
     Xt = Xt − {θ/3 top ranked samples in Xc};
    Else
     Xt = Xt − Xc;
    End if;
   End for;
     Construct an SVM based on Xt and F;
     T_c_acc = accuracy rate of SVM;
     T_c_oa = average Nr(x) of the samples in Xt based on F;
     If   T_c_acc − T_c_oa > c_acc − c_oa Then
     c_acc = T_c_acc;
     c_oa = T_c_oa;
     FS = F;
    End if;
    Rank the features in F by |w| in descending order;
    F = F − {t × |F| bottom ranked features in F};
  End while;
  Return FS;
End