title: Sequential Forward Selection (SFS) algorithm
body: <p>I'm trying to implement the <code>SFS</code> algorithm <code>pages 11-12</code> of <a href="http://research.cs.tamu.edu/prism/lectures/pr/pr_l11.pdf" rel="nofollow">this</a> document.</p>
  
  <p>What I have so far in <code>C++</code> is the following:</p>
  
  <pre><code>#include "stdafx.h"
  #include &lt;iostream&gt;
  #include &lt;vector&gt;
  #include &lt;algorithm&gt;
  #include &lt;iterator&gt;
  using namespace std;
  
  struct Features
  {
      int m_f1;
      int m_f2;
      int m_f3;
      int m_f4;
  
      Features(int a, int b, int c, int d) :
          m_f1(a),
          m_f2(b),
          m_f3(c),
          m_f4(d)
      {
  
      }
  };
  
  int criterionFunction(Features const&amp; features)
  {
      return -2 * features.m_f1 * features.m_f2 +
              3 * features.m_f3 + 
              5 * features.m_f4 +
             -2 * features.m_f1 * features.m_f2 * features.m_f3 + 
              7 * features.m_f3 +
              4 * features.m_f4 +
             -2 * features.m_f1 * features.m_f2 * features.m_f3 * features.m_f4;
  }
  
  int main(){
  
      Features feature,
      vector&lt;Features&gt; listOfFeatures(4);
  
      listOfFeatures.push_back(Features(1,0,0,0));
      listOfFeatures.push_back(Features(0,1,0,0));
      listOfFeatures.push_back(Features(0,0,1,0));
      listOfFeatures.push_back(Features(0,0,0,1));
  
      vector&lt;int&gt; listOfCriterion;
  
  }
  </code></pre>
  
  <p>My questions are:</p>
  
  <p><strong>- What is the way to make a call to <code>criterionFunction()</code> such that which ever feature passed (i.e; m_f1) will take the value <code>1</code> and which are not passed will have the value <code>0</code>?</strong></p>
  
  <p><strong>- Here, I want to select (my output) the combination of the best <code>three</code> features. How can I do that?</strong></p>