KDD data set normalization

pls i need you guys help on how to normalize the KDD cup data set, or is some thing wrong with the code i have below.
% read excel file file from computer directory.
INPUT_P= xlsread('C:\Users\5GPROGRAMER\Desktop\WORKING DIRECTORY\PROJECT WORKING DIRECTORY\TRAINING DATA\TRAIN DATA1.xlsx');
TARGET_T= xlsread('C:\Users\5GPROGRAMER\Desktop\WORKING DIRECTORY\PROJECT WORKING DIRECTORY\TRAINING DATA\OUTPUT BINARY CODE2.xlsx');
TEST_DATA= xlsread('C:\Users\5GPROGRAMER\Desktop\WORKING DIRECTORY\PROJECT WORKING DIRECTORY\TRAINING DATA\sample test.xlsx');
% convert excel file to matrix ivp and ivt
ivp=INPUT_P';
ivt=TARGET_T';
testinputs=TEST_DATA';
% start data set normalization
[pn,minp,maxp,tn,mint,maxt]=premnmx(ivp,ivt);
% creat neural network
net=newff(minmax(pn),[5 5],{'tansig','purelin'},'trainrp')

댓글 수: 1

Am working on neural network using Back propagation to detect threat, and am working with the KDD data set. But each time i test the neural network with the test data set, its not giving the accurate result. Below is the full code of the work i have been doing.
% read excel file file from computer directory.
INPUT_P= xlsread('C:\Users\5GPROGRAMER\Desktop\WORKING DIRECTORY\PROJECT WORKING DIRECTORY\TRAINING DATA\TRAIN DATA1.xlsx');
TARGET_T= xlsread('C:\Users\5GPROGRAMER\Desktop\WORKING DIRECTORY\PROJECT WORKING DIRECTORY\TRAINING DATA\OUTPUT BINARY CODE2.xlsx');
TEST_DATA= xlsread('C:\Users\5GPROGRAMER\Desktop\WORKING DIRECTORY\PROJECT WORKING DIRECTORY\TRAINING DATA\sample test.xlsx');
% convert excel file to matrix ivp and ivt
ivp=INPUT_P';
ivt=TARGET_T';
testinputs=TEST_DATA';
[pn,minp,maxp,tn,mint,maxt]=premnmx(ivp,ivt);
net=newff(minmax(pn),[5 5],{'tansig','purelin'},'trainrp')
% learning rate parameter for neural network
net.trainParam.epochs=100;
net.trainParam.lr=5.0;
net.trainParam.mc=0.6;
%train neural network (net).
net = train(net,pn,tn);
out = sim(net,testinputs);
[dummy, I]=max(out);
if (I == 1 ) h = msgbox('ATTENTION: NORMAL PACKET','Description','none'); elseif (I == 2) h = msgbox('ATTENTION: NEPTUNE ATTACK','Description','none'); elseif (I== 3) h = msgbox('ATTENTION: REMOTE TO LOCAL ATTACK','Description','none'); elseif (I== 4) h = msgbox('ATTENTION: PROBE ATTACK','Description','none'); elseif (I== 5) h = msgbox('ATTENTION: USER TO REMOTE ATTACK','Description','none'); else h = msgbox('UNCLASSIFIED ATTACK','Description','none');

댓글을 달려면 로그인하십시오.

 채택된 답변

Greg Heath
Greg Heath 2013년 7월 4일

0 개 추천

1. I do not see where you have confirmed that you have obtained acceptable results from training. Where do you compare training output trainout = sim(net,ivp) with the training target ivt? Is
NMSE = mse(ivt-trainout)/mean(var(ivt',1)) << 1 ?
2. To use the testinput you have to normalize it, use sim, then unnormalize the answer.
Hope this helps.
Thank you for formally accepting my answer
Greg

댓글 수: 3

Greg Heath
Greg Heath 2013년 7월 4일
What version of the Toolbox do you have? That version of NEWFF has been obsolete for many years. The more recent version is also obsolete. The current MLP for regression and curvefitting is FITNET.
Stephen
Stephen 2013년 7월 6일
the problem i have is the normalization, am not sure if this is correct [pn,minp,maxp,tn,mint,maxt]=premnmx(ivp,ivt);
Stephen
Stephen 2013년 7월 6일
am using Matlab 7.8.0 (R2009a)

댓글을 달려면 로그인하십시오.

추가 답변 (1개)

Greg Heath
Greg Heath 2013년 7월 8일

0 개 추천

Read the documentation on premnmx. Not only is it obsolete, it has a bug. Use mapminmax instead
help premnmx
doc premnmx
help mapminmax
doc mapminmax
Hope this helps.
Greg
PS. Always read the documentation if you have traced a problem to a particular function. If push comes to shove, you can always read the source code using the command type.

댓글 수: 1

Stephen
Stephen 2013년 8월 10일
thanks very much i used mapminmax() and it worked

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 Deep Learning Toolbox에 대해 자세히 알아보기

태그

질문:

2013년 7월 4일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by