當前位置:偏方大全网 - 藥品說明 - 關於構建壹個三層BP神經網絡對藥品的銷售進行預測(程序由matlab編寫)

關於構建壹個三層BP神經網絡對藥品的銷售進行預測(程序由matlab編寫)

clear all;

close all;

clc;

%p = [2056 2395 2600 2298 1634 1600 1837 1478 1900 2395 2600 2298 1634 1600 1873 1478 1900 1500 2600 2298 1634 1600 1873 1478 1900 1500 2046];

t = [1873 1478 1900 1500 2046 1556];

p = [ 2056 2395 2600 2298 1634 1600];

%--歸壹化輸入輸出-- 映射到[0,1]--%

pmax = max(p);

pmin = min(p);

P = (p-pmin)./(pmax-pmin);

tmax = max(t);

tmin = min(t);

T = (t-tmin)./(tmax-tmin);

net =newff(P,T,5,{'tansig','purelin'},'traingdx');

%--設置訓練參數--%

net.trainParam.show =50;

net.trainParam.lr = 0.05;

net.trainParam.epochs = 1000;

net.trainParam.goal = 1e-3;

net.divideFcn= '';

[net,tr] = train(net,P,T);

A =sim(net,P);

a =A.*(tmax - tmin)+tmin;

x = 7:12;

figure

plot(x,t,'+');

hold on;

plot(x,a,'or');

hold off;

xlabel('month');

ylabel('**')

legend('實際','預測')

  • 上一篇:零差價的藥為什麽比較貴?
  • 下一篇:西安碑林胡芙蓉診所怎麽樣?
  • copyright 2024偏方大全网