%% Construct and Train a Pattern Recognition Neural Network
% This example shows how to design a pattern recognition network to classify iris flowers.
% Load the training data.

[x,t] = iris_dataset;

% Construct a pattern network with one hidden layer of size 10.

net = patternnet(10);

% Train the network net using the training data.

net = train(net,x,t);

% View the trained network.

view(net)

% Estimate the targets using the trained network.

y = net(x);

% Assess the performance of the trained network. The default performance function is mean squared error.

perf = perform(net,t,y)
classes = vec2ind(y);

%
% Copyright 2020 The MathWorks, Inc.