%% Initialization
clc; clear all; close all;

%% Data Reading
[data,txt,raw] = xlsread('test.xlsx');


%% data size
[m n] = size(data);

xData = data(:,1:10);
yData = data(:,11);

%% Deep Neural Network 

layers = [
    featureInputLayer(10,"Name","featureinput")
    fullyConnectedLayer(20,"Name","fc_1")
    sigmoidLayer("Name","sigmoid_1")
    fullyConnectedLayer(10,"Name","fc_2")
    sigmoidLayer("Name","sigmoid_2")
    fullyConnectedLayer(5,"Name","fc_3")
    sigmoidLayer("Name","sigmoid_3")
    fullyConnectedLayer(1,"Name","fc_4")
    sigmoidLayer("Name","sigmoid_4")
    regressionLayer("Name","regressionoutput")];


%% Deep Learning parameter Configuration - training options

options = trainingOptions("sgdm", ...
    LearnRateSchedule="piecewise", ...
    LearnRateDropFactor=0.2, ...
    LearnRateDropPeriod=5, ...
    MaxEpochs=500, ...
    MiniBatchSize=64, ...
    Plots="training-progress")

%%  Deep Learning

net = trainNetwork(xData,yData,layers,options);

%% Prediction / Forecating
xx = [1 2 3 4 5 6 7 8 9 10];
y = predict(net,xx);












