I am new in using matlab so this might be easy. I am trying to make an iris dataset neural network in matlab using nntool(feed-forward back propagation network). but i cant find out what the target matrix should be. I also am trying to find (tried to create but still did nothing) a code for programming the same thing instead of using nntools. Can anyone help me out?
Asked
Active
Viewed 1,721 times
1 Answers
0
The targets are the correct class labels. However, the Fisher iris dataset in Matlab has its target data in an cell array of strings (species
), while nntool wants a numerical vector. So you'll have to convert it.
clear all;
load('fisheriris');
classnames = unique(species);
targets = zeros(1, numel(species));
for i = 1:3
class(strcmp(species, classnames{i})) = i;
end
You now have a vector targets
that can be loaded in nntool.

Junuxx
- 14,011
- 5
- 41
- 71