The Iris flower data set or Fisher's Iris data set is a multivariate data set introduced by the British statistician and biologist Ronald Fisher in his 1936 paper The use of multiple measurements in taxonomic problems as an example of linear discriminant analysis.
Deploy a Neural Network which will analyze the four features of an IRIS flower and predict its specie. We will use tensorflow to deploy the neural network.
The IRIS dataset has five columns: Sepal-Length, Sepal-Width, Petal-Length, Petal-Width, and specie. It has 150 entries (rows).
Sepal-Length, Sepal-Width, Petal-Length, and Petal-Width are numerical in nature. while, Specie is categorical. A particular flower can be any one of these three species: Iris-setosa, Iris-versicolor, Iris-virginica.
The dataset is then divided into Training and testing sets, and they contain 105 and 45 entries respectively.
test_size = 0.30
seed = 7
features_train, features_test, labels_train, labels_test = model_selection.train_test_split(features, labels, test_size=test_size,random_state=seed)
- Python 3.5.x
- Tensorflow
- Numpy
- Pandas
- SKlearn
- Jupyter Notebook (optional)
It is a three layered neural network with 4 neurons in the input layer, 8 neurons in the hidden layer, and 3 neurons in the output layer.
This arrangement predicts the species with 96% accuracy.