34
Support Vector Machine (Part 2)

Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Support Vector Machine(Part 2)

Page 2: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

OUTLINE

• Multi-class classification

• Nonlinear mapping

• Kernel

Page 3: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

The Solution of Quiz-2• The maximum margin weight vector will be parallel to the shortest line connecting points of the

two classes, that is, the line between (1,1) and (2,3), giving a weight vector of (1,2)

• Working algebraically, with the standard constraint that:

Minimize ||w|| subject to

• For some a;

a+2a + b = -1

2a + 6a + b = 1

a= 2/5, b=- 11/5, so the optimal hyperplane is given by w = (2/5 , 4/5) and b = -11/5.

The large margin M is 2/ ||w|| 2/4

25+

16

25= 5

Page 4: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Multi-class Classification

Page 5: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Multi-class Classification

Page 6: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Multi-class Classification

Source code example: http://scikit-learn.org/stable/modules/multiclass.html

Page 7: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [http://www.cs.stevens.edu/~mordohai/classes/cs559_s10/Week10.pdf]

Page 8: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points
Page 9: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [http://www.cs.stevens.edu/~mordohai/classes/cs559_s10/Week10.pdf]

Page 10: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [http://www.cs.stevens.edu/~mordohai/classes/cs559_s10/Week10.pdf]

Page 11: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [http://www.cs.stevens.edu/~mordohai/classes/cs559_s10/Week10.pdf]

Page 12: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [http://www.cs.stevens.edu/~mordohai/classes/cs559_s10/Week10.pdf]

Page 13: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [http://www.cs.stevens.edu/~mordohai/classes/cs559_s10/Week10.pdf]

Page 14: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [http://www.cs.stevens.edu/~mordohai/classes/cs559_s10/Week10.pdf]

Page 15: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [http://www.cs.stevens.edu/~mordohai/classes/cs559_s10/Week10.pdf]

Page 16: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points
Page 17: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [http://sli.ics.uci.edu/Classes/2016W-178?action=download&upname=07_svm.pdf]

Page 18: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points
Page 19: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points
Page 20: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points
Page 21: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [https://class.coursera.org/ml-005/lecture/74]

Page 22: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [https://class.coursera.org/ml-005/lecture/74]

Page 23: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [https://class.coursera.org/ml-005/lecture/74]

Page 24: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [https://class.coursera.org/ml-005/lecture/74]

Page 25: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [https://class.coursera.org/ml-005/lecture/74]

Page 26: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Gaussian Kernel Example (1)

Source: [https://class.coursera.org/ml-005/lecture/74]

Page 27: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Gaussian Kernel Example (2)

Source: [https://class.coursera.org/ml-005/lecture/74]

Page 28: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Gaussian Kernel Example (3)

Source: [https://class.coursera.org/ml-005/lecture/74]

Page 29: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [https://class.coursera.org/ml-005/lecture/74]

Page 30: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [https://class.coursera.org/ml-005/lecture/74]

Page 31: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [https://class.coursera.org/ml-005/lecture/74]

Page 32: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Source: [https://class.coursera.org/ml-005/lecture/74]

Page 33: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

Demo

• http://scikit-learn.org/stable/modules/svm.html

• http://scikit-learn.org/stable/auto_examples/plot_multilabel.html#example-plot-multilabel-py

• http://scikit-learn.org/stable/auto_examples/svm/plot_svm_nonlinear.html

• http://scikit-learn.org/stable/auto_examples/svm/plot_svm_kernels.html

• http://scikit-learn.org/stable/auto_examples/svm/plot_custom_kernel.html

Page 34: Support Vector Machine (Part 2)aykut/classes/spring2016/bbm406/... · The Solution of Quiz-2 •The maximum margin weight vector will be parallel to the shortest line connecting points

References

• http://cs229.stanford.edu/notes/cs229-notes3.pdf

• https://class.coursera.org/ml-005/lecture/74

• http://www.cs.stevens.edu/~mordohai/classes/cs559_s10/Week10.pdf

• http://nlp.stanford.edu/IR-book/html/htmledition/support-vector-machines-the-linearly-separable-case-1.html

• http://www.holehouse.org/mlclass/12_Support_Vector_Machines.html