Using different classification algorithms on Iris Dataset (it was created in Dec 2019)
Dataset: Iris Dataset
Using python programing language.
The iris dataset contains the following data
• 50 samples of 3 different species of iris (150 samples total)
• 3 Classes : "0": setosa,"1": versicolor,"2": virginica
• 4 Features , dataset is 150 * 4 Matrix
• Features: sepal length, sepal width, petal length, petal width
Algorithms:
PCA :
Converting 4 dimensional to 2 dimensional
Converting 2 dimensional to 1 dimensional:
Red is class 0 , green is class 1 , blue is class 2
LDA : Converting 4 dimensional to 2 dimensional
Converting 2 dimensional to 1 dimensional:
Perceptron:
• First, reduce features to 2 dimensions using LDA: • Learning Rate=0.01 • Iteration =15 • Weights after training [ 77.90162435 433.32165847 35.24875973]
Multi-Layer Perceptron :
• First, reduce features to 2 dimensions using LDA:
• Iteration : 1000
• Input Layer : 2 nodes
• One hidden layer : 100 nodes
• Out Layer: 3 nodes
• Loss Rate per every 100:
o number of epoch 0 loss 1.058013916015625
o number of epoch 100 loss 0.7257269024848938
o number of epoch 200 loss 0.6850542426109314
o number of epoch 300 loss 0.6629276275634766
o number of epoch 400 loss 0.6485032439231873
o number of epoch 500 loss 0.6379558444023132
o number of epoch 600 loss 0.6296232342720032
o number of epoch 700 loss 0.6226478219032288
o number of epoch 800 loss 0.6165931224822998
o number of epoch 900 loss 0.6112104058265686
K-Means • First, reduce features to 2 dimensions using LDA: • K_Classes =3 • Output Centroid Center: o [-7.60759993 0.21513302] o [ 5.75542597 0.52437413] o [ 1.77251575 -0.76530064]
Test Cases :