- 博客(2)
- 收藏
- 关注
转载 MATLAB实现PLA算法
x0 = ones(20, 1);x1 = rand(20, 2)*10;x = [x0, x1];test = rand(20, 1);y = ones(20, 1);for i=1:20 if x1(i, 1)>6 y(i) = -1; endendj=1;for i=1:20 if y(i)==-1
2017-09-08 20:40:24 870
转载 Python实现PLA算法
import numpy as np#for array computefrom numpy import *import randomdef pla(): W=np.ones(4)#initial all weight with 1 count=0 dataset=[[1,0.10723,0.64385, 0.29556 ,1],
2017-09-08 18:54:18 843
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人