how to predict from a trained neural network ?

Hello I am trying to use neural network to make some prediction based on my input and target data. I have read all related tutorial in Matlab and also looked at the matlab examples. I kinda learned how to develop a network but I dont know how to use this train network to make some prediction ? is there any code that im missing ? does anyone have a sample script that can be shared here?
that's what I have, for example : x=[1 2 3;4 5 3] t=[0.5 0.6 0.7] , net=feedforwardnet(10) , net=train(net,x,t) , perf=perform(net,y,t)
how can I predict the output for a new set of x (xprime=[4 2 3;4 7 8]) based on this trained network? thanks

 채택된 답변

Greg Heath
Greg Heath 2018년 1월 16일

0 개 추천

1. Your code should yield an error because you have not defined y.
here are two ways to define output y, error e and normalized mean square error NMSE (= 1-Rsquare)
1. [ net tr ] = train(net,x,t);
y = net(x);
e = t-y;
2. [ net tr y e ] = train(net,x,t); % My favorite
then, in general,
NMSE = mse(e)/mean(var(t',1))
or for 1-dimensional outputs
NMSE = mse(e)/var(t,1)
Hope this helps.
Greg

추가 답변 (1개)

Mritula C
Mritula C 2019년 2월 14일

0 개 추천

Hi How do you predicted with a new test class?

댓글 수: 1

Greg Heath
Greg Heath 2019년 2월 15일
  1. You misplaced your commented question into an Answer Box.
  2. This is a regression prolem. Your question involves classification.
Greg

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

카테고리

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

질문:

2018년 1월 15일

댓글:

2019년 2월 15일

Community Treasure Hunt

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

Start Hunting!

Translated by