Iris setosa, Iris versicolor and Iris virginica are closely-related species. They differ by the size of their petal and sepal.
For instance the dataset below list the height and width of the petals of different specimens, and whether these specimens belong to the species setosa.
import pandas as pd
df = pd.read_csv('./data/setosa/train.csv')
df.head(6)
Based on this dataset, and given the petal height and width of a new specimen, we would like to predict the probability that this specimen belongs to the species setosa.
Neural networks are an extremeley versatile machine learning technique.
They consist in stacking individual units (a.k.a. artificial neurons) that :
tanh
function).Training the network consists in finding the right values for the weights $w_i$.
In order to solve the problem of classification for Iris setosa, we will start with the simplest kind of neural network: a single layer network.
For the non-linear function, we will choose the sigmoid function, since its output is between 0 and 1 and can thus easily be interpreted as a probability.
With this model, we have: $ p_{setosa} = f( w_0 + w_1\times height + w_2 \times width )$, and training the model consists in finding $w_1$ and $w_2$.