写在前面
之前只停留在理论上,没有实际沉下心去调参,实际去做了后,发现调参是个大工程(玄学)。于是这篇来总结一下sklearn中svm的参数说明以及调参经验。方便以后查询和回忆。
常用核函数
1.linear核函数:
K(xi,xj)=xTixjK(xi,xj)=xiTxj
2.polynomial核函数:
K(xi,xj)=(γxTixj+r)d,d>1K(xi,xj)=(γxiTxj+r)d,d>1
3.RBF核函数(高斯核函数):
K(xi,xj)=exp(−γ||xi−xj||2),γ>0K(xi,xj)=exp(−γ||xi−xj||2),γ>0
4.sigmoid核函数:
K(xi,xj)=tanh(γxTixj+r),γ>0,r<0K(xi,xj)=tanh(γxiTxj+r),γ>0,r<0
sklearn svm 相关参数的官方说明
Parameters:
C : float, optional (default=1.0). Penalty parameter C of the error term.
kernel : string, optional (default=’rbf’). Specifies the kernel type to be used in the algorithm. It must be one of ‘linear’, ‘poly’, ‘rbf’, ‘sigmoid’, ‘precomputed’ or a callable. If none is given, ‘rbf’ will be used. If a callable is given it is used to pre-compute the