覲 企 碁..

http://blog.acronym.co.kr/m/433

x <- 1/8
ep <- -x * log(x, base=2) * 8
ep

襯 れ, 覈 襷觚 10. 朱朱 螳 轟 譬 蟆渚願 蟆渚 蟆企. 蟆曙 10 朱 5 豪Μ襯 蟆朱 蠍磯讌襷 10 覈 覦壱り 覃 蟆渚 螻蟆 蟆願 企 ろ碁るゼ 蟆讌 覈詩 螻螳れ 危 蟆企. 讀, 蟆渚 蠍磯 覦螳 螻, 蠏 蠍磯 覦襯 豢譟煙貅譯殊 覈詩る 譟一 覿覿企.

覓朱 10 10 覈 豪Μ 蟆 譬 蟆渚 . 企 殊 . 殊 豸′ Entropy螳 麹. 豪 蟆曙 50%螳 Entropy螳 螳 . 讀, 伎 豪 覿 蠏 50% 蠏覿.

buys <- c("no", "no", "yes", "yes", "yes", "no", "yes", "no", "yes", "yes", "yes", "yes", "yes", "no")
freqs <- table(buys)/length(buys)
ep <- -sum(freqs * log2(freqs))
ep