ρ
≥
1
\bm{\rho \ge 1}
ρ≥1为多项式函数的次数
σ
>
1
\bm{\sigma \gt 1}
σ>1为多项式函数的次数
σ
>
0
,
θ
<
0
\bm{\sigma \gt 0,\theta \lt 0}
σ>0,θ<0
K
(
x
,
z
)
=
x
⋅
z
\bm{K (x,z) = x·z}
K(x,z)=x⋅z
K
(
x
,
z
)
=
(
x
⋅
z
+
1
)
p
\bm{K (x,z) = (x·z+1)^p}
K(x,z)=(x⋅z+1)p
K
(
x
,
z
)
=
e
x
p
(
−
∥
x
−
z
∥
2
2
σ
2
)
\bm{K (x,z) = exp(- \cfrac{\Vert x-z\Vert ^2}{2\sigma ^2} )}
K(x,z)=exp(−2σ2∥x−z∥2)
K
(
x
,
z
)
=
t
a
n
h
(
δ
(
x
⋅
z
+
c
)
)
\bm{K (x,z) = tanh(\delta (x·z+c))}
K(x,z)=tanh(δ(x⋅z+c))
线性可分支持向量机算法:
1.给定训练集
S
=
{
(
x
1
,
y
1
)
,
(
x
2
,
y
2
)
,
⋅
⋅
⋅
(
x
n
,
y
n
)
}
,
i
=
1
,
2
,
3
⋅
⋅
⋅
N
,
x
i
∈
R
n
,
y
i
∈
{
1
,
2
,
3
,
4
}
\bm{ S = \{ (x_1,y_1),(x_2,y_2),···(x_n,y_n) \},i = 1,2,3···N,x_i \in R^n ,y_i \in\{ 1,2,3,4 \}}
S={(x1,y1),(x2,y2),⋅⋅⋅(xn,yn)},i=1,2,3⋅⋅⋅N,xi∈Rn,yi∈{1,2,3,4} ,其中
N
N
N为样本数目,
x
i
\bm{x_i}
xi为第
i
i
i个特征向量,
y
i
y_i
yi为
x
i
x_i
xi的标记,假定
y
i
=
1
y_i = 1
yi=1时候为正例,故当
y
i
=
1
y_i = 1
yi=1时,
x
i
x_i
xi为正例,
y
i
≠
1
y_i \neq1
yi=1时,
x
i
x_i
xi为负例,循环假定四次,可将一个四分类问题转化成四个二分类问题。
2.构造最优化问题:
m
i
n
1
2
∥
w
∥
2
\bm{min \quad \cfrac{1}{2} \Vert w \Vert ^ 2}
min21∥w∥2
s
.
t
.
y
i
(
w
x
i
+
b
)
−
1
≥
0
\bm{s.t. \quad y_i(wx_i+b)-1 \ge 0 }
s.t.yi(wxi+b)−1≥0
求得最优解为:
w
∗
,
b
∗
w^*,b^*
w∗,b∗
3.由此可得到分离超平面:
w
∗
⋅
x
+
b
∗
=
0
\bm{w^*·x+b^* = 0}
w∗⋅x+b∗=0
4.构造分类决策函数:
f
(
x
)
=
s
i
g
n
(
w
∗
⋅
x
+
b
∗
)
\bm{f(x) = sign(w^*·x+b^*)}
f(x)=sign(w∗⋅x+b∗),其中
s
i
g
n
\bm {sign}
sign 为符号函数,
s
i
g
n
(
x
)
=
{
+
1
,
x
≥
0
−
1
,
x
<
0
\bm{sign(x) = \begin{cases} +1,& \text{x} \ge 0\\-1,& \text{x}\lt0 \end{cases} }
sign(x)={+1,−1,x≥0x<0
由于原始最优化问题不便于求解,因此引入其对偶算法,容易证明原始问题与对偶问题有相同的最
优解。
对偶算法:
1.给定训练集
S
=
{
(
x
1
,
y
1
)
,
(
x
2
,
y
2
)
,
⋅
⋅
⋅
(
x
n
,
y
n
)
}
,
i
=
1
,
2
,
3
⋅
⋅
⋅
N
,
x
i
∈
R
n
,
y
i
∈
{
1
,
2
,
3
,
4
}
\bm{ S = \{ (x_1,y_1),(x_2,y_2),···(x_n,y_n) \},i = 1,2,3···N,x_i \in R^n ,y_i \in\{ 1,2,3,4 \}}
S={(x1,y1),(x2,y2),⋅⋅⋅(xn,yn)},i=1,2,3⋅⋅⋅N,xi∈Rn,yi∈{1,2,3,4}
2.构造最优问题:
m
i
n
1
2
∑
i
=
1
N
∑
j
=
1
N
α
i
α
j
y
i
y
j
(
x
i
⋅
x
j
)
−
∑
i
=
1
N
α
i
\bm{min \quad \cfrac{1}{2} \sum_{i=1}^N \sum_{j=1}^N \alpha_i \alpha_j y_iy_j(x_i·x_j)- \sum_{i=1}^N \alpha_i}
min21∑i=1N∑j=1Nαiαjyiyj(xi⋅xj)−∑i=1Nαi
s
.
t
.
∑
i
=
1
N
α
i
y
i
=
0
,
α
i
≥
0
,
i
=
1
,
2
⋅
⋅
⋅
,
N
\bm{s.t. \quad \sum_{i=1}^N \alpha_iy_i=0,\qquad \alpha_i \ge0,i=1,2···,N}
s.t.∑i=1Nαiyi=0,αi≥0,i=1,2⋅⋅⋅,N
3.计算
w
∗
=
∑
i
=
1
N
α
i
∗
y
i
x
i
\bm{w^* = \sum_{i=1}^N \alpha_i ^* y_i x_i}
w∗=∑i=1Nαi∗yixi
选择
α
∗
\bm{\alpha^*}
α∗的一个正分量
α
j
≥
0
\bm{\alpha_j \ge0}
αj≥0,计算
b
∗
=
y
j
−
∑
i
=
1
N
α
i
∗
y
i
(
x
i
⋅
x
j
)
\bm{b^* = y_j-\sum_{i=1}^N\alpha_i^*y_i(x_i·x_j)}
b∗=yj−∑i=1Nαi∗yi(xi⋅xj)
4.由此得到超平面:
w
∗
⋅
x
+
b
∗
=
0
\bm{w^*·x + b^* = 0}
w∗⋅x+b∗=0
5.构造分类决策函数:
f
(
x
)
=
s
i
g
n
(
w
∗
⋅
x
+
b
∗
)
\bm{f(x) =sign(w^*·x +b^*)}
f(x)=sign(w∗⋅x+b∗)
2 ∥ w ∥ \bm{\cfrac{2}{\Vert w \Vert}} ∥w∥2
w = ∑ i = 1 N α i y i x i \bm{w = \sum_{i=1}^N \alpha_iy_ix_i} w=∑i=1Nαiyixi
∥ w ∥ 2 \bm{\Vert w \Vert ^2} ∥w∥2
x i j \bm{x_{ij}} xij
∑ i = 1 N ∂ ∥ w ∥ 2 ∂ x i j = γ ∣ w j ∣ \bm{\sum_{i=1}^N \cfrac{\partial \Vert w \Vert^2}{\partial x_{ij} } = \gamma \vert w_j \vert} ∑i=1N∂xij∂∥w∥2=γ∣wj∣
v j = w j ∗ 2 ∑ j = 1 k w j ∗ 2 \bm{v_j = \cfrac{w_j^{*2} }{\sum _{j=1}^k w_j^{*2}} } vj=∑j=1kwj∗2wj∗2
(1)残差检验
绝对残差:
ϵ
(
k
)
=
x
(
0
)
(
k
)
,
k
=
2
,
3
,
⋅
⋅
⋅
,
n
{\epsilon(k) = x^{(0)}(k) ,k=2,3,···,n}
ϵ(k)=x(0)(k),k=2,3,⋅⋅⋅,n
相对残差:
ϵ
(
k
)
=
∣
x
(
0
)
(
k
)
−
x
^
(
k
)
∣
x
(
0
)
(
k
)
×
100
%
{\epsilon(k) = \cfrac{\vert x^{(0)} (k) - \hat{x} (k) \vert}{x^{(0)}(k)} \times100\%}
ϵ(k)=x(0)(k)∣x(0)(k)−x^(k)∣×100%
如果
ϵ
r
ˉ
<
20
%
{\bar{\epsilon_r} \lt 20\%}
ϵrˉ<20%,则认为GM(1,1)对原数据的拟合达到一般要求。
如果
ϵ
r
ˉ
<
10
%
{\bar{\epsilon_r} \lt 10\%}
ϵrˉ<10%,则认为GM(1,1)对原数据的拟合效果非常不错。
(2)级比偏差检验
首先由
x
(
0
)
(
k
−
1
)
x^{(0)}(k-1)
x(0)(k−1)和
x
(
0
)
(
k
)
{x^{(0)} (k)}
x(0)(k)计算出原始数据的级比
σ
(
k
)
\sigma(k)
σ(k):
σ
(
k
)
=
x
(
0
)
(
k
)
x
(
0
)
(
k
−
1
)
(
k
=
2
,
3
,
⋅
⋅
⋅
n
)
{\sigma(k) = \cfrac{x^{(0)(k)}} {x^{(0)} (k-1)}(k=2,3,···n) }
σ(k)=x(0)(k−1)x(0)(k)(k=2,3,⋅⋅⋅n)
再根据预测出来的发展系数(
−
a
^
{- \hat{a}}
−a^)计算出相应的级比偏差和平均级比偏差:
η
(
k
)
=
∣
1
−
1
−
0.5
a
^
1
+
0.5
a
^
1
σ
(
k
)
∣
{ \eta(k) = \vert 1- \cfrac{1-0.5\hat{a}} {1+0.5\hat{a}} \cfrac{1}{\sigma(k)} \vert }
η(k)=∣1−1+0.5a^1−0.5a^σ(k)1∣,
η
ˉ
=
∑
k
=
2
n
η
(
k
)
/
(
n
−
1
)
{\bar{\eta} = \sum_{k=2}^n \eta(k)/(n-1)}
ηˉ=∑k=2nη(k)/(n−1)
如果
η
ˉ
<
0.2
{\bar{\eta} \lt 0.2}
ηˉ<0.2,则认为GM(1,1)对原数据的拟合达到一般要求。
如果
η
ˉ
<
0.1
{\bar{\eta} \lt 0.1}
ηˉ<0.1,则认为GM(1,1)对原数据的拟合效果非常不错。