Microsoft SQL Server 2005 Data Mining Nave Bayes
Microsoft SQL Server 2005 Data Mining 演算法 – Naïve Bayes 謝邦昌 輔仁大學統計資訊學系 教授 中華資料採礦協會 理事長 stat 1001@mails. fju. edu. tw WWW. CDMS. ORG. TW 1
Naïve Bayes Classifier 單純貝氏分類 2
Bayesian Classification • Bayes Theorem: P(H|X)=P(X|H)P(H)/P(X) –Let X is a data sample whose class label is unknown –Let H be a class label –P(H) is the prior probability of H –P(H|X) is the posterior probability of H conditioned on X –Example • X: a red and round object • C: being an apple or an orange • H: being an apple (H C) 26
Naive Bayesian Classification Classify X=(age=“<=30”, income=“medium”, student=“yes”, credit-rating=“fair”) – – – – P(buys_computer=yes) = 9/14 P(buys_computer=no)=5/14 P(age=<30|buys_computer=yes)=2/9 P(age=<30|buys_computer=no)=3/5 P(income=medium|buys_computer=yes)=4/9 P(income=medium|buys_computer=no)=2/5 P(student=yes|buys_computer=yes)=6/9 P(student=yes|buys_computer=no)=1/5 P(credit-rating=fair|buys_computer=yes)=6/9 P(credit-rating =fair|buys_computer=no)=2/5 P(X|buys_computer=yes)=0. 044 P(X|buys_computer=no)=0. 019 P(buys_computer=yes|X) P(X|buys_computer=yes) P(buys_computer=yes)=0. 028 – P(buys_computer=no|X) P(X|buys_computer=no) P(buys_computer=no)=0. 007 27
Microsoft Naive Bayesian • Easy to Train Model • Algorithm Parameters – MAXIMUM_INPUT_ATTRIBUTES • 超過此值會自動啟動欄位篩選機置 – MAXIMUM_STATES • 類型屬性項目最大值 – MINIMUM_DEPENDENCY_PROBABILITY • 介於 0~1,數值越大,模型使用變數會減少 28
Dependency Network 30
Reserved Strong Links 31
Attribute Profile 32
Attribute Characteristics 33
Attribute Characteristics 34
Attribute Discrimination 35
Column Mapping 36
Column Mapping 37
Lift Chart 38
Confusion Matrix 39
建立Naïve Bayes 分類模型 41
建立Naïve Bayes 分類模型 43
執行Naïve Bayes 分類模型 45
建立Naïve Bayes 分類模型 精確度之檢視Lift Chart 64
建立Naïve Bayes 分類模型 精確度之檢視Profit Chart 65
建立Naïve Bayes 分類模型 精確度之檢視Profit Chart 66
建立Naïve Bayes 分類模型精確度 之檢視Classification Matrix 67
檢視不同Naïve Bayes 分類模型 之精確度(Profit Chart) 82
檢視不同Naïve Bayes 分類模型 之精確度(Profit Chart) 83
- Slides: 87