在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
%% 生成二类线性可分数据 function [feature, category]=generate_sample(step,error) aa=3; %斜率 bb=3; %截距 b1=1; rr =error; s=step; x1(:,1) = -1:s:1; n = length(x1(:,1)); x1(:,2) = aa.*x1(:,1) + bb + b1 + rr*abs(randn(n,1)); y1 = -ones(n,1); x2(:,1) = -1:s:1; x2(:,2) = aa.*x2(:,1) + bb - b1 - rr*abs(randn(n,1)); y2 = ones(n,1); %figure; %plot(x1(:,1),x1(:,2),'bx',x2(:,1),x2(:,2),'k.'); feature=[x1;x2]; category=[y1;y2]; |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论