Can this problem be solved with a single layer perceptron?

9 views (last 30 days)
Iris Plants Database1 is perhaps the best-known database to be found in the pattern recognition literature. The data set contains three species of flowers (classes) setosa, versicolour and virginica. It contains 3 classes of 50 instances each, where each class refers to a type of iris plant. One class (setosa) is linearly separable from the other 2; the latter are NOT linearly separable from each other. The database contains the following attributes in cm: petal width, petal length, sepal width, and sepal length.

Answers (1)

Jayanti
Jayanti on 3 Jul 2025
Hi Amna,
A single-layer perceptron is only capable of solving linearly separable data. It can correctly classify Setosa versus the other two classes. However, it cannot distinguish between Versicolour and Virginica due to the non-linear decision boundary required.
To solve the full 3-class classification problem use Multi-Layer Perceptron. MLPs can handle non-linear separability by learning complex patterns through hidden layers and non-linear activation functions.
To create and train MLP refer to the below code (assuming X is input feature and T is target):
net = patternnet(10);
net = train(net, X, T);
% Predict outputs through trained network
predicted = net(X);
You can also refer to the offical MathWorks documentation on “patternnet” for your reference:

Community Treasure Hunt

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

Start Hunting!