Linear classification

Classification, to find out which bounder side of a point or get the bounder to separate the dataset. This article is mainly about Linear Classification, using one hyper plane to separate the dataset.

 

as for the signed distance y

 

here comes the neuron:

 

the function f is a transfer function, used to prevent y from changing too much by aliens or noise. f can be step function, linear step function or tanh. As usual the error defined as:

E=0.5*(z-t)^2, z is the output of the neuron and t is the class of the points, so that the 1st order derivate is:

update each vi as vi(t + 1) = vi(t) + ∆vi(t)

refference:

http://www.marmakoide.org/download/teaching/dm/dm-perceptron-1.pdf

Note that the linear classification can’t separate data with a non-linear frontier, neither a dataset with multidimensional data. For some dataset, a better initialization is needed, set the Vector C be the median of the data, the Vector V be one unit vector. Use MLP to get a better separation.

<view code>

result:

eta= 0.5 iteration=3
0.07076422200317212 0.08188117302023934
eta= 0.01 iteration=2
-0.6969402564832946 0.7171348353723
eta= 0.001 iteration=255
-0.6648463748271787 0.6683932978172582
test 2: ==========================
no Optimization:
 too much time 。。。
use median to do the optimization
100.5 100.5
eta= 0.5 iteration=6
eta= 0.01 iteration=115
100.49434892035956 100.50567408374293
test 3: ==========================
seperate the dataset into 30% testing part and 70% training part,
using the percentage to determine when to stop the learning
iteration= 300
 percentage: 0.88 test: 0.9083333333333333  train: 0.8678571428571429
-353.0333900061246 -763.5366403901546 -251.38913455734232
Vector write with cluster_id finished

some samples && linear classify:

转载于:https://www.cnblogs.com/sunshinewill/archive/2013/04/11/3013747.html

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值