Linear Kernel: Why is it recommended for text classification ?

The Support Vector Machine can be viewed as a kernel machine. As a result, you can change its behavior by using a different kernel function.

The most popular kernel functions are :

  • the linear kernel
  • the polynomial kernel
  • the RBF (Gaussian) kernel
  • the string kernel

The linear kernel is often recommended for text classification

It is interesting to note that :

The original optimal hyperplane algorithm proposed by Vapnik in 1963 was a linear classifier [1]

That's only 30 years later that the kernel trick was introduced.

If it is the simpler algorithm, why is the linear kernel recommended for text classification?

Text is often linearly separable

Most of text classification problems are linearly separable [2]

Linear kernel works well with linearly separable data

Linear kernel works well with linearly separable data

Text has a lot of features

The linear kernel is good when there is a lot of features. That's because mapping the data to a higher dimensional space does not really improve the performance. [3]  In text classification, both the numbers of instances (document) and features (words) are large.

linearKernlVsRbf

As we can see in the image above, the decision boundary produced by a RBF kernel when the data is linearly separable is almost the same as the decision boundary produced by a linear kernel. Mapping data to a higher dimensional space using an RBF kernel was not useful.

Linear kernel is faster

Training a SVM with a linear kernel is faster than with another kernel. Particularly when using a dedicated library such as LibLinear [3]

Less parameters to optimize

When you train a SVM with a linear kernel, you only need to optimize the C regularization parameter.  When training with other kernels, you also need to optimize the \gamma parameter which means that performing a grid search will usually take more time.

Conclusion

Linear kernel is indeed very well suited for text-categorization.

Keep in mind however that it is not the only solution and in some case using another kernel might be better.

The recommended approach for text classification is to try a linear kernel first, because of its advantages.
If however you search to get the best possible classification performance, it might be interesting to try the other kernels to see if they help.

References

[1]  Support Vector Machines Article
[2] Text Categorization with Support Vector Machines: Learning with Many Relevant Features
[3] A Practical Guide to Support Vector Classification 

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值