Skip to main content
. 2012 Mar 21;13(Suppl 3):S7. doi: 10.1186/1471-2105-13-S3-S7

Table 3.

Pseudocode for a Monte Carlo wrapper-based feature selection algorithm

MCW(S, N)
 1. xout = -∞
 2. For i = 1 to N
  Si = randomSubset(S)
  (xi, Ci) = performance(Si)
  If xi >xout,
   Sout = Si, xout = xi, cout = randomElement(Ci)
 3. output Sout, xout, cout

The input, S, is the set of all features, and N is the total number of feature subsets to draw randomly. The variable xi is the performance of the top classifier for subset Si, and Ci is the label of the top classifier. Sout, xout, and cout, return the top performing feature set, top estimated performance, and top classifier, respectively.