Hi,
I am working on Decision Tree practice lab section 4.1. I found that below statement is misleading because taking 0 as input of logarithm with any basis is treated as infinity, instead it’s written as log2(0)=0.
- For implementation purposes, 0log2(0)=0. That is, if
p_1 = 0
orp_1 = 1
, set the entropy to0
I thought I didn’t need an if-else statement to deal with p_1=0 or p_1=1 until I noticed that I relied to wrong statement.
Feel free to correct me if I’m wrong.
Thanks,
awidianto