Cost Function of Support Vector Machine

Logistic Regression 中的函数 f,g f , g

f(x)=ln(1+ex),xR,g(x)=f(x) f ( x ) = ln ⁡ ( 1 + e x ) , x ∈ R , g ( x ) = f ( − x )

f,g f , g 的性质

f(x)=ex1+ex>0,xR f ′ ( x ) = e x 1 + e x > 0 , x ∈ R
f′′(x)=(ex1+ex)=ex(1+ex)2>0,xR f ″ ( x ) = ( e x 1 + e x ) ′ = e x ( 1 + e x ) 2 > 0 , x ∈ R
limx+f(x)=+,limxf(x)=0 lim x → + ∞ f ( x ) = + ∞ , lim x → − ∞ f ( x ) = 0
limxf(x)x=limxf(x)=1 lim x → − ∞ f ( x ) x = lim x → − ∞ f ′ ( x ) = 1
limx+[f(x)x]=limx+ln(1+ex)=0 lim x → + ∞ [ f ( x ) − x ] = lim x → + ∞ ln ⁡ ( 1 + e − x ) = 0

g(x)=f(x)=ln(1+ex),xR g ( x ) = f ( − x ) = ln ⁡ ( 1 + e − x ) , x ∈ R
g(x)=11+exex(1)=11+ex<0,xR g ′ ( x ) = 1 1 + e − x e − x ( − 1 ) = − 1 1 + e x < 0 , x ∈ R
g′′(x)=(11+ex)=ex(1+ex)2>0,xR g ″ ( x ) = − ( 1 1 + e x ) ′ = e x ( 1 + e x ) 2 > 0 , x ∈ R

SVM 的函数 cost0,cost1 cost 0 , cost 1

cost0(x)=max(0,x1) c o s t 0 ( x ) = max ( 0 , x − 1 )
cost1(x)=max(0,1x) c o s t 1 ( x ) = max ( 0 , 1 − x )

Cost function of Logistic Regression

hθ(Xi)=11+eθXi h θ ( X i ) = 1 1 + e − θ ⊺ X i
J(θ)=1mi=1m{yiln(hθ(Xi))+(1yi)ln(1hθ(Xi))}+λ2mj=1nθ2j J ( θ ) = − 1 m ∑ i = 1 m { y i ln ⁡ ( h θ ( X i ) ) + ( 1 − y i ) ln ⁡ ( 1 − h θ ( X i ) ) } + λ 2 m ∑ j = 1 n θ j 2
lnhθ(Xi)=g(θXi) − ln ⁡ h θ ( X i ) = g ( θ ⊺ X i )
ln(1hθ(Xi))=f(θXi) − ln ⁡ ( 1 − h θ ( X i ) ) = f ( θ ⊺ X i )
于是 J(θ)=i=1m[yig(θXi)+(1yi)f(θXi)]+λ2mj=1nθ2j J ( θ ) = ∑ i = 1 m [ y i g ( θ ⊺ X i ) + ( 1 − y i ) f ( θ ⊺ X i ) ] + λ 2 m ∑ j = 1 n θ j 2

Cost function of Support Vector Machine

hθ(Xi)={1,0,θXi0,otherwise, h θ ( X i ) = { 1 , θ ⊺ X i ≥ 0 , 0 , otherwise ,
J(θ)=Ci=1m[yicost1(θXi)+(1yi)cost0(θXi)]+j=1nλ2θ2j J ( θ ) = C ∑ i = 1 m [ y i cost 1 ⁡ ( θ ⊺ X i ) + ( 1 − y i ) cost 0 ⁡ ( θ ⊺ X i ) ] + ∑ j = 1 n λ 2 θ j 2

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值