- Hands-On Machine Learning with Microsoft Excel 2019
- Julio Cesar Rodriguez Martino
- 166字
- 2021-06-24 15:11:03
Entropy calculation
The frequency table for the combination Outlook-Train outside is as follows:

Using these values, we get the entropy of two variables, as shown here in detail:

p(Sunny).S(Sunny)+p(Overcast).S(Overcast)+p(Rainy)*S(Rainy)=
5/14*(-3/5*log2(3/5)-2/5*log2(2/5)) +
4/14*(-4/4*log2(4/4)-0/4*log2(0/4))+
5/14*(-2/5*log2(2/5)-3/5*log2(3/5))=
0.693
Here, p(Sunny) = (#Yes+#No)/Total entries = (2+3)/14, p(Overcast) = (#Yes+#No)/Total entries = (4+0)/14, and p(Rainy) = (#Yes+#No)/Total entries = (2+3)/14. The entropy values S(v) are calculated using the corresponding probabilities, that is, #Yes or #No over the total #Yes+#No.
The frequency table for the combination Temperature-Train outside is as follows:

Using these values and an analogous calculation, the entropy is shown in detail here:

p(Hot).S(Hot)+p(Mild).S(Mild)+p(Cool)*S(Cool)=
4/14*(-2/4*log2(2/4)-2/4*log2(2/4)) +
6/14*(-4/6*log2(4/6)-2/6*log2(2/6))+
4/14*(-3/4*log2(3/4)-1/4*log2(1/4)) =
0,911
The frequency table for the combination Humidity-Train outside is as follows:

Using these values, we get the entropy as follows:

p(High).S(High)+p(Normal).S(Normal)=
7/14*(-3/7*log2(3/7)-4/7*log2(4/7)) +
7/14*(-6/7*log2(6/7)-1/7*log2(1/7))=
0,788
The frequency table for the combination Windy-Train outside is as follows:

Using these values, we get the entropy as follows:

p(True).S(True)+p(False).S(False)=
8/14*(-6/8*log2(6/8)-2/8*log2(2/8)) +
6/14*(-3/6*log2(3/6)-3/6*log2(3/6))
=0,892
- 計算機組成原理與接口技術:基于MIPS架構實驗教程(第2版)
- 企業數字化創新引擎:企業級PaaS平臺HZERO
- 程序員修煉之道:從小工到專家
- 數據可視化:從小白到數據工程師的成長之路
- 數據分析實戰:基于EXCEL和SPSS系列工具的實踐
- Word 2010中文版完全自學手冊
- Python金融大數據分析(第2版)
- 數據庫應用基礎教程(Visual FoxPro 9.0)
- WS-BPEL 2.0 Beginner's Guide
- 大數據營銷:如何讓營銷更具吸引力
- 數字媒體交互設計(初級):Web產品交互設計方法與案例
- 數據庫技術實用教程
- 圖數據實戰:用圖思維和圖技術解決復雜問題
- Apache Kylin權威指南
- 淘寶、天貓電商數據分析與挖掘實戰(第2版)