功能: 设置核函数类型

格式: 
SVMSetType(svm, type, a, b, c)
SVMSetType(svm, type, a, b)
SVMSetType(svm, type, c)
SVMSetType(svm, type)

svm : 由{SVMCreate<矩阵运算\SVMCreate>}创建的SVM对象
type: 字符串存储分类器类型,具体可看下说明.此参数默认为线性分类器
a、b、c: 分类器对应的系数

说明:
1. 设置成功返回1
2. type目前支持如下分类器,其中K为核函数:
(1)Line
线性核函数
$$
K(x_1,x_2) = x_1^Tx_2
$$

(2)Gauss
高斯核函数
$$
K(x_1, x_2) = \exp(-\dfrac{||x1 - x2||^2}{2a^2}), 默认参数 a = 1
$$

(3)Poly
多项式核函数
$$
K(x_1, x_2) = (ax_1^Tx_2 + b)^c, 默认参数 a = 1, b = 0, c = 2
$$

(4)Exp
自然指数核函数
$$
K(x_1, x_2) = \exp(-a^2||x_1 - x_2||), 默认参数 a = 1
$$

(5)Cauchy
Cauchy核函数
$$
K(x_1, x_2) = \dfrac{a^2}{a^2 + ||x_1 - x_2||^2}, 默认参数 a = 1
$$

(6)Sigmod
Sigmoid核函数
$$
K(x_1, x_2) = \tanh(ax_1^Tx_2 + b), 默认参数 a = 1, b = 0
$$

(7)RQuad
有理二次核函数
$$
K(x_1, x_2) = 1 - {||x_1 - x_2||^2}{||x_1 - x_2||^2 + a}, 默认参数 a = 1
$$

(8)MQuad
多二次核函数
$$
K(x_1, x_2) = \sqrt{||x_1 - x_2||^2 + a^2}, 默认参数 a = 1
$$

(9)InvMQuad
逆多二次核函数
$$
K(x_1, x_2) = \dfrac{1}{\sqrt{||x_1 - x_2||^2 + a^2}}, 默认参数 a = 1
$$

(10)Circula
圆核函数
$$
K(x_1, x_2) = \begin{cases}
\dfrac{2}{\pi}\arccos(-\dfrac{||x_1 - x_2||}{a}) - \dfrac{2}{\pi}\dfrac{||x_1 - x_2||}{a}\sqrt{1 - \dfrac{||x_1 - x_2||}{a}}&, ||x_1 - x_2|| < a
\\
0&, ||x_1 - x_2|| >= a
\end{cases},默认参数 a = 1
$$

(11)Spherical
球核函数
$$
K(x_1, x_2) = \begin{cases}
1 - \dfrac{3||x_1 - x_2||}{2a} + \dfrac{1}{2} (\dfrac{||x_1 - x_2||}{a})^3&, ||x_1 - x_2|| < a
\\
0&, ||x_1 - x_2|| >= a
\end{cases}, 默认参数 a = 1
$$
例子:

SVMSetType(svm, "Gauss", 4.0);//设置高斯核函数