probability and statistics
play

Probability and Statistics for Computer Science - PowerPoint PPT Presentation

Probability and Statistics for Computer Science many problems are naturally classifica4on problems---Prof. Forsyth Credit: wikipedia Hongye


  1. Probability ¡and ¡Statistics ¡ ì ¡ for ¡Computer ¡Science ¡ ¡ “…many ¡problems ¡are ¡naturally ¡ classifica4on ¡problems”-­‑-­‑-­‑Prof. ¡ Forsyth ¡ Credit: ¡wikipedia ¡ Hongye ¡Liu, ¡Teaching ¡Assistant ¡Prof, ¡CS361, ¡UIUC, ¡11.14.2019 ¡

  2. Last ¡time ¡ ✺ Decision ¡tree ¡ ✺ Random ¡forest ¡

  3. Content ¡ ✺ Recap ¡of ¡Support ¡vector ¡machine ¡ ✺ Support ¡vector ¡machine ¡(II) ¡ ✺ The ¡curse ¡of ¡dimensionality ¡ ✺ Mul4variate ¡normal ¡distribu4on ¡

  4. Considerations ¡in ¡choosing ¡a ¡classifier ¡ ✺ When ¡solving ¡a ¡classifica4on ¡problem, ¡it ¡is ¡good ¡to ¡ try ¡several ¡techniques. ¡ ✺ Criteria ¡to ¡consider ¡in ¡choosing ¡the ¡classifier ¡include ¡ ✺ Accuracy ¡ ✺ Training ¡speed ¡ ✺ Classifica4on ¡speed ¡ ✺ Performance ¡with ¡small ¡training ¡set ¡ ✺ Interpretability ¡ ¡

  5. Motivation ¡for ¡Studying ¡Support ¡Vector ¡ Machine ¡ ✺ When ¡solving ¡a ¡classifica4on ¡problem, ¡it ¡is ¡good ¡to ¡ try ¡several ¡techniques. ¡ ✺ Criteria ¡to ¡consider ¡in ¡choosing ¡the ¡classifier ¡include ¡ ✺ Accuracy ¡ ✔ ¡ ✺ Training ¡speed ¡ ✺ Classifica4on ¡speed ¡ ✔ ¡ ✺ Performance ¡with ¡small ¡training ¡set ¡ ✺ Interpretability ¡ ¡ ✔ ¡

  6. SVM ¡problem ¡formulation ¡ ✺ At ¡first ¡we ¡assume ¡a ¡binary ¡classifica4on ¡problem ¡ ✺ The ¡training ¡set ¡consists ¡of ¡N ¡items ¡ ✺ Feature ¡vectors ¡x i ¡of ¡dimension ¡d ¡ ✺ Corresponding ¡class ¡labels ¡ ¡ y i ∈ {± 1 } x (2) ✺ We ¡can ¡picture ¡the ¡training ¡ data ¡as ¡a ¡d-­‑dimensional ¡ sca[er ¡plot ¡with ¡colored ¡ labels ¡ x (1)

  7. Decision ¡boundary ¡of ¡SVM ¡ ✺ SVM ¡uses ¡a ¡hyperplane ¡as ¡its ¡ decision ¡boundary ¡ x (2) a T x + b = 0 ✺ The ¡decision ¡boundary ¡is: ¡ a 1 x (1) + a 2 x (2) + ... + a d x ( d ) + b = 0 ✺ In ¡vector ¡nota4on, ¡the ¡ x (1) hyperplane ¡can ¡be ¡wri[en ¡as: ¡ a T x + b = 0

  8. Classification ¡function ¡of ¡SVM ¡ ✺ SVM ¡assigns ¡a ¡class ¡label ¡to ¡a ¡ x (2) feature ¡vector ¡according ¡to ¡the ¡ a T x + b = 0 following ¡rule: ¡ +1 ¡if ¡ ¡ a T x i + b ≥ 0 -­‑1 ¡ ¡if ¡ a T x i + b < 0 ✺ In ¡other ¡words, ¡the ¡classifica4on ¡ x (1) func4on ¡is: ¡ sign ( a T x i + b ) ✺ Note ¡that ¡ ¡ If ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡is ¡small, ¡then ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡was ¡close ¡to ¡the ¡decision ¡ � a T x i + b � � ✺ x i � boundary ¡ If ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡is ¡large, ¡then ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡was ¡far ¡from ¡the ¡decision ¡ ✺ � � a T x i + b � x i � boundary ¡ ¡

  9. What ¡if ¡there ¡is ¡no ¡clean ¡cut ¡boundary? ¡ ✺ Some ¡boundaries ¡are ¡be[er ¡ x (2) than ¡others ¡for ¡the ¡training ¡data ¡ a T x + b = 0 ✺ Some ¡boundaries ¡are ¡likely ¡more ¡ robust ¡for ¡run-­‑4me ¡data ¡ ✺ We ¡need ¡to ¡a ¡quan4ta4ve ¡ x (1) measure ¡to ¡decide ¡about ¡the ¡ boundary ¡ ✺ The ¡ loss ¡func0on ¡can ¡help ¡ decide ¡if ¡one ¡boundary ¡is ¡be[er ¡ than ¡others ¡

  10. Loss ¡function ¡1 ¡ ✺ For ¡any ¡given ¡feature ¡vector ¡ ¡ ¡ ¡ ¡ ¡ ¡with ¡class ¡label ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡, ¡ y i ∈ {± 1 } x i we ¡want ¡ ¡ sign ( a T x i + b ) = y i Zero ¡loss ¡if ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡is ¡classified ¡correctly ¡ ✺ x i Posi4ve ¡loss ¡if ¡ ¡ ¡ ¡ ¡ ¡ ¡is ¡misclassified ¡ sign ( a T x i + b ) � = y i ✺ x i If ¡ ¡ ¡ ¡ ¡ ¡is ¡misclassified, ¡more ¡loss ¡is ¡assigned ¡if ¡it’s ¡further ¡away ¡ ✺ x i from ¡the ¡boundary ¡ ✺ This ¡loss ¡func4on ¡1 ¡meets ¡the ¡criteria ¡above: ¡ max (0 , − y i ( a T x i + b )) Loss ¡ ✺ Training ¡error ¡cost ¡ N S ( a , b ) = 1 � max (0 , − y i ( a T x i + b )) y i ( a T x i + b ) N i =1

  11. Q. ¡What’s ¡the ¡value ¡of ¡this ¡function ¡ ¡? ¡ max (0 , − y i ( a T x i + b )) if ¡ ¡ sign ( a T x i + b ) = y i A. ¡ ¡0. ¡ ¡ B. ¡ ¡others. ¡

  12. Q. ¡What’s ¡the ¡value ¡of ¡this ¡function ¡ ¡? ¡ max (0 , − y i ( a T x i + b )) if ¡ ¡ sign ( a T x i + b ) � = y i A. ¡ ¡0. ¡ ¡ B. ¡ ¡A ¡value ¡greater ¡ ¡ than ¡or ¡equal ¡to ¡0. ¡

  13. Loss ¡function ¡1 ¡ ✺ For ¡any ¡given ¡feature ¡vector ¡ ¡ ¡ ¡ ¡ ¡ ¡with ¡class ¡label ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡, ¡ y i ∈ {± 1 } x i we ¡want ¡ ¡ sign ( a T x i + b ) = y i Zero ¡loss ¡if ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡is ¡classified ¡correctly ¡ ✺ x i Posi4ve ¡loss ¡if ¡ ¡ ¡ ¡ ¡ ¡ ¡is ¡misclassified ¡ sign ( a T x i + b ) � = y i ✺ x i If ¡ ¡ ¡ ¡ ¡ ¡is ¡misclassified, ¡more ¡loss ¡is ¡assigned ¡if ¡it’s ¡further ¡away ¡ ✺ x i from ¡the ¡boundary ¡ ✺ This ¡loss ¡func4on ¡1 ¡meets ¡the ¡criteria ¡above: ¡ max (0 , − y i ( a T x i + b )) Loss ¡ ✺ Training ¡error ¡cost ¡ N S ( a , b ) = 1 � max (0 , − y i ( a T x i + b )) y i ( a T x i + b ) N i =1

  14. The ¡problem ¡with ¡loss ¡function ¡1 ¡ ✺ Loss ¡func4on1 ¡does ¡not ¡dis4nguish ¡between ¡the ¡following ¡ decision ¡boundaries ¡if ¡they ¡both ¡classify ¡ ¡ ¡ ¡ ¡ ¡correctly. ¡ x i One ¡passes ¡the ¡two ¡classes ¡closely ¡ ✺ One ¡that ¡passes ¡with ¡a ¡wider ¡margin ¡ ✺ ✔ ¡ ✺ But ¡leaving ¡a ¡larger ¡margin ¡ gives ¡robustness ¡for ¡run-­‑4me ¡ data-­‑ ¡ the ¡large ¡margin ¡ principle ¡ Credit: ¡Kelvin ¡Murphy ¡ ¡

  15. Loss ¡function ¡2: ¡the ¡hinge ¡loss ¡ ✺ We ¡want ¡to ¡impose ¡a ¡small ¡posi4ve ¡loss ¡if ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡is ¡correctly ¡ x i classified ¡but ¡close ¡to ¡the ¡boundary ¡ ✺ The ¡ hinge ¡loss ¡func4on ¡meets ¡the ¡criteria ¡above: ¡ max (0 , 1 − y i ( a T x i + b )) ✺ Training ¡error ¡cost ¡ N Loss ¡ S ( a , b ) = 1 � max (0 , 1 − y i ( a T x i + b )) N i =1 1 ¡ y i ( a T x i + b )

  16. The ¡problem ¡with ¡loss ¡function ¡2 ¡ ✺ Loss ¡func4on ¡2 ¡favors ¡decision ¡boundaries ¡that ¡have ¡large ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ � a � because ¡increasing ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡can ¡zero ¡out ¡the ¡loss ¡for ¡a ¡correctly ¡ � a � classified ¡ ¡ ¡ ¡ ¡ ¡ ¡near ¡the ¡boundary. ¡ x i ¡ ✺ But ¡large ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡makes ¡the ¡classifica4on ¡func4on ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ sign ( a T x i + b ) � a � extremely ¡sensi4ve ¡to ¡small ¡changes ¡in ¡ ¡ ¡ ¡ ¡ ¡ ¡and ¡make ¡it ¡less ¡ x i robust ¡to ¡run-­‑4me ¡data. ¡ ✺ So ¡small ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡ ¡is ¡be[er. ¡ � a �

  17. Hinge ¡loss ¡with ¡regularization ¡penalty ¡ ✺ We ¡add ¡a ¡penalty ¡on ¡the ¡square ¡magnitude ¡ ¡ � a � 2 = a T a ¡ ✺ Training ¡error ¡cost ¡ � � N + λ ( a T a 1 � max (0 , 1 − y i ( a T x i + b )) S ( a , b ) = 2 ) N i =1 ✺ The ¡ regulariza0on ¡parameter ¡ ¡ ¡ ¡ ¡trade ¡off ¡between ¡these ¡two ¡ λ objec4ves ¡

  18. Q. ¡What ¡does ¡the ¡penalty ¡discourage? ¡ � � N + λ ( a T a 1 � max (0 , 1 − y i ( a T x i + b )) S ( a , b ) = 2 ) N i =1 A. ¡ ¡Too ¡big ¡a ¡magnitude ¡of ¡the ¡ vector ¡ a ¡ ¡ B. ¡ ¡Too ¡many ¡data ¡points ¡in ¡the ¡ training ¡set ¡

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend