title: Calculating conditional entropy for a decision tree
body: <p>I'm trying to calculate conditional entropy in order to calculate information gain for decision trees. I'm having a little trouble with the implementation in Java. An example may look like:</p>
  
  <pre><code> X   Y  f(x)   
   1   0   A
   1   0   A
   0   1   B
  </code></pre>
  
  <p>Given this example, how would I go about calculating conditional entropy in Java? I understand the math behind it but am just confused on the implementation.</p>
  
  <p>An example can be found here: <a href="http://en.wikipedia.org/wiki/Conditional_entropy" rel="nofollow">http://en.wikipedia.org/wiki/Conditional_entropy</a></p>