├── .gitattributes ├── ANN_DataPreprocessing.py ├── Abstract.pdf └── Multivariate_windspeed_prediction_ANN.m /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | -------------------------------------------------------------------------------- /ANN_DataPreprocessing.py: -------------------------------------------------------------------------------- 1 | f = open("temp.csv","r") 2 | str=f.read() 3 | f1=open("means.csv","w") 4 | li=str.split('\n') 5 | i=1 6 | while len(li) > 9: 7 | ti=li[:10] 8 | try: 9 | ti=[float(x) for x in ti] 10 | except ValueError,e: 11 | print ("error",e,"on line",i) 12 | li=li[10:] 13 | m=sum(ti)/10 14 | print(m,file=f1) 15 | i=i+1 16 | f.close() 17 | f1.close() 18 | -------------------------------------------------------------------------------- /Abstract.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Sohan-Rai/Multivariate-windspeed-prediction-using-ANN/53eb205e721424e65d04b8bf22417655c9f05dd7/Abstract.pdf -------------------------------------------------------------------------------- /Multivariate_windspeed_prediction_ANN.m: -------------------------------------------------------------------------------- 1 | Y=xlsread('apr5speed.xlsx'); 2 | t=Y'; 3 | Y1=xlsread('apr5direction.xlsx'); 4 | t1=Y1'; 5 | X=con2seq(t1); 6 | T=con2seq(t); 7 | N = 144; 8 | inputseries = X(1:end-N); 9 | targetseries = T(1:end-N); 10 | inputseriesvalidation = X(end-N+1:end); 11 | targetseriesvalidation = T(end-N+1:end); 12 | delay =200; 13 | hiddenlayer =20; 14 | net = narxnet(1:delay,1:delay,hiddenlayer); 15 | [Xs,Xi,Ai,Ts] = preparets(net,inputseries,{},targetseries); 16 | net = train(net,Xs,Ts,Xi,Ai); 17 | Y = net(Xs,Xi,Ai); 18 | perf = perform(net,Ts,Y); 19 | inputseriesprediction = [inputSeries(end-delay+1:end),inputseriesvalidation]; 20 | targetseriesprediction = [targetseries(end-delay+1:end), con2seq(nan(1,N))]; 21 | netc = closeloop(net); 22 | [Xs,Xi,Ai,Ts] = preparets(netc,inputseriesprediction,{},targetseriesprediction); 23 | prediction = netc(Xs,Xi,Ai); 24 | perf = perform(net,prediction,targetseriesvalidation); 25 | figure; 26 | plot([cell2mat(prediction); cell2mat(targetseriesvalidation)]') 27 | legend('Network Predictions','Expected Outputs') 28 | --------------------------------------------------------------------------------