Home / Predictive Modeling & Machine Learning / 203.3.4 How to Calculate Entropy for Decision Tree Split?

203.3.4 How to Calculate Entropy for Decision Tree Split?

LAB: Entropy Calculation – Example

  • Calculate entropy at the root for the given population
  • Calculate the entropy for the two distinct gender segments

Code- Entropy Calculation

  • Entropy at root 100%
  • Male Segment : (-48/60)log(48/60,2)-(12/60)log(12/60,2)
  • 0.7219281
  • FemaleSegment : (-2/40)log(2/40,2)-(38/40)log(38/40,2)
  • 0.286397

About admin

Check Also

204.3.10 Pruning a Decision Tree in Python

Pruning Growing the tree beyond a certain level of complexity leads to overfitting In our …

Leave a Reply

Your email address will not be published. Required fields are marked *