MATLAB Answers

what is x,t and y variables in this code?

13 views (last 30 days)
sankari senthil
sankari senthil on 1 Feb 2017
Commented: Walter Roberson on 15 Sep 2019
[x,t] = simplefit_dataset;
net = feedforwardnet(10);
net = train(net,x,t);
view(net)
y = net(x);
perf = perform(net,y,t)

  0 Comments

Sign in to comment.

Answers (3)

Greg Heath
Greg Heath on 1 Feb 2017
x is the input matrix with N I-dimensional input columns
t is the output target matrix with N O-dimensional output target columns
vart1 = mean(var(t',1)) is the mean target variance
y is the output matrix with N O-dimensional output columns
e = t - y is the error matrix
NMSE = mse(e)/vart1 is the normalized output mean-squared-error
I prefer NMSE < 0.01 as a goal for regression and pattern-recognition,
NMSEo < 0.001 as a goal for open-loop time-series and
NMSEc < 0.01 as a goal for closed-loop time-series
Hope this helps.
Thank you for formally accepting my answer
Greg

  0 Comments

Sign in to comment.


Walter Roberson
Walter Roberson on 1 Feb 2017
x is the data. t is the class information.
y is the result of running prediction using the input data. When the prediction for an input does not match the known target for the input then the Neural Net is not as good is it could be.

  0 Comments

Sign in to comment.


Sadiq Akbar
Sadiq Akbar on 11 Sep 2019
[x,t] = simplefit_dataset;
Using this how can I enter my own inputs and traget data. e.g. if my input=[1; 2; 3; 4; 5]; and my target=[1 2 3 4;2 4 6 8;3 6 9 12;4 8 12 16;5 10 15 20]; Now WhenI eneter my this data via command window and enter these commands also i.e.
input=[1; 2; 3; 4; 5];
target=[1 2 3 4;2 4 6 8;3 6 9 12;4 8 12 16;5 10 15 20];
net = fitnet(10);
view(net)
net = train(net,x,yes);
view(net)
yes = net(x);
perf = perform(net,yes,t)
net = fitnet(10,'trainbr');
net = train(net,x,t);
yes = net(x);
perf = perform(net,yes,t)
I get this error:
RefFitNetExample
Undefined function or variable 'x'.
Error in RefFitNetExample (line 19)
net = train(net,x,yes);
So how to tacke this problem.

  3 Comments

Walter Roberson
Walter Roberson on 11 Sep 2019
net = train(net, input, target);
Caution: it is... unusual... to have your target data wider than your input data, especially when your input is vector.
Sadiq Akbar
Sadiq Akbar on 15 Sep 2019
Input data is always in the form of vector and output may be greater than input as in my case. You mean to say we cannot treat this with above code. If yes , then how can we tackle this problem please?
Walter Roberson
Walter Roberson on 15 Sep 2019
net = train(net, input.', target.');

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!

Translated by