Last article ：「14」 Support vector machine —— I finished , Who supports ？ Who is against ？, We go through SVM This is the most common machine learning algorithm . In this article, we use a very simple python Let's practice the actual project SVM And deepen understanding of .
SVM It's a two category model , The data processed can be divided into three categories ：
Linear classifier , It corresponds to a straight line on a plane ; Nonlinear classifier , It corresponds to a curve on a plane .
Hard intervals correspond to linearly separable data sets , All samples can be classified correctly , That's why , Affected by the noise samples , Not recommended .
The soft interval corresponds to the usual data set （ Approximately linearly separable or linearly nonseparable ）, Some samples near the hyperplane are allowed to be misclassified , This improves the generalization performance .
Here's the picture ：
The solid line is obtained by maximizing the hard interval