Chapter 3�Introduction to Predictive Modeling : From Correlation to Supervised Segmentation 建立預測模型 --- 從關連到監督式區隔
1
2
3
4
5
6
Outline
7
Models, Induction, and Prediction
8
Models, Induction, and Prediction
9
Models, Induction, and Prediction
10
預測是否會有呆帳
Models, Induction, and Prediction
11
Terminology : Induction and deduction
12
模型
資料檔
學習演算法
學習模型
應用模型
類別值
Induction
歸納
Deduction
推論
一個歸納的案例
13
貝氏定理應用
14
如果約見面時間是星期五,對方會遲到的機率約67%
Outline
15
Supervised Segmentation 監督式區隔�
16
Supervised Segmentation監督式區隔�
17
Supervised Segmentation監督式區隔�
18
Outline
19
Selecting Informative Attributes選擇具傳遞訊息能力的屬性�
20
Selecting Informative Attributes選擇具傳遞訊息能力的屬性�
21
Selecting Informative Attributes
22
Selecting Informative Attributes
23
Selecting Informative Attributes
24
Selecting Informative Attributes
25
Selecting Informative Attributes
26
Selecting Informative Attributes
p(non-write-off) = 5/ 10 = 0.5
p(write-off) = 5 / 10 = 0.5
entropy(S)
= - 0.5 × log2 (0.5) – 0.5 × log2 (0.5)
= - 0.5 × - 1 - 0.5 × - 1
= 0.5 + 0.5 = 1 最不純
27
Selecting Informative Attributes
p(non-write-off) = 10/ 10 = 1
p(write-off) = 0 / 10 = 0
entropy(S)
= - 1 × log2 (1) – 0 × log2 (0)
= -1 × 0 - 0 × - ∞
= 0 + 0 = 0 最純
28
Selecting Informative Attributes
p(non-write-off) = 7 / 10 = 0.7
p(write-off) = 3 / 10 = 0.3
entropy(S)
= - 0.7 × log2 (0.7) – 0.3 × log2 (0.3)
≈ - 0.7 × - 0.51 - 0.3 × - 1.74
≈ 0.88
29
Selecting Informative Attributes
30
Selecting Informative Attributes
entropy(parent)
= - p( • ) × log2 p( • ) - p( ☆ ) × log2 p( ☆ )
≈ - 0.53 × - 0.9 - 0.47 × - 1.1
≈ 0.99 (very impure)
31
Selecting Informative Attributes
entropy(Balance < 50K) = - p( • ) × log2 p( • ) - p( ☆ ) × log2 p( ☆ )
≈ - 0.92 × ( - 0.12) - 0.08 × ( - 3.7)
≈ 0.39
entropy(Balance ≥ 50K) = - p( • ) × log2 p( • ) - p( ☆ ) × log2 p( ☆ )
≈ - 0.24 × ( - 2.1) - 0.76 × ( - 0.39)
≈ 0.79
32
Selecting Informative Attributes
Information Gain
= entropy(parent)
- (p(Balance < 50K) × entropy(Balance < 50K) +
p(Balance ≥ 50K) × entropy(Balance ≥ 50K))
≈ 0.99 – (0.43 × 0.39 + 0.57 × 0.79)
≈ 0.37
33
Selecting Informative Attributes
entropy(parent) ≈ 0.99
entropy(Residence=OWN) ≈ 0.54
entropy(Residence=RENT) ≈ 0.97
entropy(Residence=OTHER) ≈ 0.98
Information Gain ≈ 0.13
34
Numeric variables
35
Outline
36
Example: Attribute Selection with Information Gain用Information Gain去選取屬性��
37
Example: Attribute Selection with Information Gain 用Information Gain去選取屬性�
38
香菇資料集
39
GILL:香菇的菌褶
SPORE:香菇孢子
香菇帽
香菇柄
香菇面紗
40
Example: Attribute Selection with Information Gain 用Information Gain去選取屬性�
41
Example: Attribute Selection with Information Gain 用Information Gain去選取屬性�
42
Example: Attribute Selection with Information Gain 用Information Gain去選取屬性�
43
Example: Attribute Selection with Information Gain 用Information Gain去選取屬性�
44
Example: Attribute Selection with Information Gain 用Information Gain去選取屬性�
45
Example: Attribute Selection with Information Gain 用Information Gain去選取屬性�
46
Example: Attribute Selection with Information Gain 用Information Gain去選取屬性�
47
Example: Attribute Selection with Information Gain 用Information Gain去選取屬性�
48
Example: Attribute Selection with Information Gain 用Information Gain去選取屬性�
49
Outline
50
Supervised Segmentation with Tree-Structured Models 用樹狀模型進行監督式區隔 ��
51
Supervised Segmentation with Tree-Structured Models 用樹狀模型進行監督式區隔 ��
52
Supervised Segmentation with Tree-Structured Models用樹狀模型進行監督式區隔 �
53
Supervised Segmentation with Tree-Structured Models �
54
Supervised Segmentation with Tree-Structured Models 用樹狀模型進行監督式區隔 �
55
Supervised Segmentation with Tree-Structured Models 用樹狀模型進行監督式區隔 �
56
Supervised Segmentation with Tree-Structured Models 用樹狀模型進行監督式區隔 �
57
Selecting Informative Attributes 選取具傳遞訊息能力的屬性
58
Supervised Segmentation with Tree-Structured Models 用樹狀模型進行監督式區隔 �
59
Supervised Segmentation with Tree-Structured Models 用樹狀模型進行監督式區隔 �
60
Supervised Segmentation with Tree-Structured Models 用樹狀模型進行監督式區隔 �
61
62
Supervised Segmentation with Tree-Structured Models 用樹狀模型進行監督式區隔 �
63
Supervised Segmentation with Tree-Structured Models 用樹狀模型進行監督式區隔 �
64
Visualizing Segmentations 用視覺化方式呈現區隔
65
Visualizing Segmentations
66
Visualizing Segmentations
*The black dots correspond to instances of the class Write-off.
*The plus signs correspond to instances of class non-Write-off.
67
Trees as Sets of Rules
68
Trees as Sets of Rules
69
Trees as Sets of Rules
70
Trees as Sets of Rules
71
Probability Estimation
72
Probability Estimation
73
Probability Estimation Tree
74
Probability Estimation
75
Probability Estimation
76
Probability Estimation
77
Example: Addressing the Churn Problem with Tree Induction
78
Example: Addressing the Churn Problem with Tree Induction 用樹狀歸納法處理預測客戶流失問題
79
Example: Addressing the Churn Problem with Tree Induction
of each attribute, as discussed earlier. Specifically, we apply Equation 3-2 to each variable independently over the entire set of instances, to see what each gains us. 為此,我們計算每一變數的information gain.
80
81
82
Example: Addressing the Churn Problem with Tree Induction
83
Example: Addressing the Churn Problem with Tree Induction
84