I. Project Background:
User load forecasting in a Scandinavian area as the subject, a random sample of 300 users for one year of data, the user types include residential users and business users, which is given priority to with residential users, with 300 users to predict the total load, 24 hours prior to predict, randomly selected from 36 days data of the year as the test set, other data for the training set.
Thinking a
Users can be clustered through the 24-hour daily load curve, and then the total power consumption of each user can be predicted, and the predicted value of the total load can be obtained after superposition.
Idea 2
The total load can be predicted directly
Excerpts from training Set
Load0 ~load299 (I:KV), 7897 lines in total Excerpts from test set
Construct INPUT and OUTPUT
We choose A:E as the INPUT. Why: The requirements on the test set can be inversely derived.
3. Build BP neural network
3.1 Use xlsread to read the file and name it 3.2 Do the transpose of the matrix 3.3 Build the network BP 3.4 Use the trained network to predict the test set
The sample demo:
CLC clear close all %% load train. Mat input_datas = (input_datas)'; output_datas = (output_datas)'; Net = newff(input_datas,output_datas, [10], {'logsig' 'purelin'}, 'traingdx', 'learngDM '); % count * data input data for the characteristics, the output vector for the category number * data net. TrainParam. ShowWindow = 0; % do not display window net.trainparam.show = 10; % Display the training result every 50 steps net.trainparam.epochs = 200; % Maximum number of training steps allowed 200 net.trainparam.goal = 0.0001; % training target minimum error 0.0001 net.trainparam.lr = 0.0005; Net = train(net,input_datas,output_datas); Test = xlsread('test.xlsx'); input_test = test'; predict_output = sim( net,input_test)' ;Copy the code