決策樹狀圖:隨堂測驗
本頁面會挑戰您回答一系列的複選練習,內容涵蓋「訓練決策樹」單元中討論的內容。
第 1 題
使用精確數值分隔器,將數值特徵替換為負值 (例如將值 +8 變更為 -8) 會產生什麼效果?
系統會學習相同的條件,只會切換正面/負面子項。
吹得太好了!
系統會學習不同的條件,但決策樹的整體結構會維持不變。
如果功能有所變更,條件也會隨之變動。
決策樹的結構會完全不同。
決策樹的結構實際上會大致相同。但條件會有所不同。
第 2 題
哪兩個答案最能說明只測試 X 中候選閾值值的一半 (隨機選取) 的效果?
第 3 題
如果「資訊增益」與「閾值」曲線有許多局部極大值,會發生什麼情況?
不可能有多個局部極大值。
可能會有多個局部極大值。
第 4 題
計算下列分割作業的資訊增益:
節點 | 正面示例數量 | 排除範例數量 |
父節點 | 10 | 6 |
第一個子項 | 8 | 2 |
第二個子項 | 2 | 4 |
按一下圖示即可查看答案。
# Positive label distribution
p_parent = 10 / (10+6) # = 0.625
p_child_1 = 8 / (8+2) # = 0.8
p_child_2 = 2 / (2+4) # = 0.3333333
# Entropy
h_parent = -p_parent * log(p_parent) - (1-p_parent) * log(1-p_parent) # = 0.6615632
h_child_1 = ... # = 0.5004024
h_child_2 = ... # = 0.6365142
# Ratio of example in the child 1
s = (8+2)/(10+6)
f_final = s * h_child_1 + (1-s) * h_child_2 # = 0.5514443
information_gain = h_parent - f_final # = 0.1101189
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2025-02-25 (世界標準時間)。
[null,null,["上次更新時間:2025-02-25 (世界標準時間)。"],[[["This webpage presents a series of multiple-choice exercises focused on evaluating your understanding of decision tree training concepts."],["The exercises cover topics such as the impact of feature manipulation on decision tree structure, the effects of altering threshold selection strategies, and the implications of multiple local maxima in information gain curves."],["One question requires calculating information gain using entropy and provided data, demonstrating the practical application of decision tree principles."]]],[]]