Artificial Neural Network code for this dataset?

 채택된 답변

Majid Farzaneh
Majid Farzaneh 2018년 5월 31일
Hi, you can use something like this:
I=xlsread('forneuralnetworkdataset.xls');
inputs=I(:,1:3)';
targets=I(:,4)';
net=feedforwardnet(10);
net=train(net,inputs,targets);

댓글 수: 3

Debalina Pal
Debalina Pal 2018년 5월 31일
편집: Debalina Pal 2018년 5월 31일
Thanks..But how can i test some sample data here? suppose I have temperature data,humidity data and pressure sample data.I want to see its corresponding weather class as per dataset.Then how can i write this code for ann?
You're welcome. You have the trained net. Simply use the net as a function:
out=net([28;89;993])
or
test_data=I(1:10,1:3)';
outs=net(test_data);
Note that the output of a default feed-forward network is not integer. You can use round, ceil, floor or fix function to round the output.
out=round(net([28;89;993]))
another question is that: I=xlsread('forneuralnetworkdataset.xlsx'); inputs=I(:,1:3)'; targets=I(:,4)'; net=feedforwardnet(10); net=train(net,inputs,targets); display(net); out=round(net([28;89;993])); display(out); In this above code I want to define a function and I want to pass this inputs as input arguments through this function.

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

추가 답변 (0개)

카테고리

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

태그

질문:

2018년 5월 31일

댓글:

2018년 6월 1일

Community Treasure Hunt

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

Start Hunting!

Translated by