核SVM

Python 中的线性分类器

Michael (Mike) Gelbart

Instructor, The University of British Columbia

特征变换

Python 中的线性分类器

特征变换

Python 中的线性分类器

特征变换

$\textrm{transformed feature} =$

$ (\textrm{original feature})^2$

Python 中的线性分类器

特征变换

$\textrm{transformed feature} =$

$ (\textrm{original feature})^2$

Python 中的线性分类器

特征变换

$\textrm{transformed feature} =$

$ (\textrm{original feature})^2$

Python 中的线性分类器

核SVM

from sklearn.svm import SVC

svm = SVC(gamma=1)    # default is kernel="rbf"

Python 中的线性分类器

核SVM

from sklearn.svm import SVC

svm = SVC(gamma=0.01) # default is kernel="rbf"

  • 更小的 gamma 会得到更平滑的边界
Python 中的线性分类器

核SVM

from sklearn.svm import SVC

svm = SVC(gamma=2)    # default is kernel="rbf"

  • 更大的 gamma 会得到更复杂的边界
Python 中的线性分类器

开始练习!

Python 中的线性分类器

Preparing Video For Download...