机器学习基础支持向量机svm分类

In the previous stories, I had given an explanation of the program for implementation of various Regression models. Also, I had described the implementation of the Logistic Regression and the KNN Classification model. In this article, we shall see the algorithm and the implementation of the SVM Classification with a crisp example.

在先前的故事中 ,我已经解释了用于实现各种回归模型的程序。 另外,我已经描述了Logistic回归和KNN分类模型的实现。 在本文中,我们将通过一个清晰的示例了解SVM分类的算法和实现。

SVM分类概述 (Overview of SVM Classification)

The Support Vector Machine (SVM) Classification is similar to the SVR that I had explained in my previous story. In SVM, the line that is used to separate the classes is referred to as hyperplane. The data points on either side of the hyperplane that are closest to the hyperplane are called Support Vectors which is used to plot the boundary line.

支持向量机(SVM)分类类似于我在上一个故事中解释的SVR。 在SVM中,用于分隔类的线称为hyperplane 。 超平面两侧最靠近超平面的数据点称为支持向量 ,用于绘制边界线。

In SVM Classification, the data can be either linear or non-linear. There are different kernels that can be set in an SVM Classifier. For a linear dataset, we can set the kernel as ‘linear’.

在SVM分类中,数据可以是线性的也可以是非线性的。 在SVM分类器中可以设置不同的内核。 对于线性数据集,我们可以将内核设置为“ 线性 ”。

On the other hand, for a non-linear dataset, there are two kernels, namely ‘rbf’ and ‘polynomial’. In this, the data is mapped to a higher dimension which makes it easier to draw the hyperplane. Afterwards, it is brought down to the lower dimension.

另一方面,对于非线性数据集,有两个内核,即“ rbf ”和“ 多项式 ”。 这样,数据被映射到更高的维度,这使得绘制超平面更加容易。 之后,将其降低到较低的尺寸。

Image for post
SVM Mechanism (Source — Self)
SVM机制(来源-自我)

From the above diagram, we can see that there are two classes of shapes, rectangle and circle. As it is difficult to draw a SVM line in the 2D Plane, we map the data points to a higher dimension (3D Plane) and then draw the hyperplane. It is then brought down to the original plane with the SVM Classifier drawn in red color.

从上图可以看出,有两类形状:矩形和圆形。 由于很难在2D平面中绘制SVM线,因此我们将数据点映射到更高的维度(3D平面),然后绘制超平面。 然后使用红色绘制的SVM分类器将其放到原始平面。

In this way, the SVM Classifier can be used to classify a data point to which class it belongs from the g

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值