Machine Learning — Week 3
Quote for the day: “Learning never exhausts the mind.” — leonardo da Vinci
Last week, we touch base on Classifier. There are different types of classifier:
Decision Tree
Artificial Neural Network
Vector Machine
Lions & Tigers
Classifier is an algorithm in which we train our data and then label it based on the output, or simply we can call it as Supervised Machine Learning.
Today we will train our Classifier with iris flower data set. For more information on iris flower data set, please click the below link.
Our training data set looks like:

Here, the feature is (Sepal Length, Sepal Width, Petal Length and Petal Width) and Label (Species).
In a layman term, we are providing 4 data sets/features input and predict a label to be either setosa, versicolor or virginica.
As mentioned above, we are loading iris data set into our Python code. By default scikit learn provides Iris flower data set in our library. Please feel free to load it.
from sklearn.datasets import load_iris
iris = load_iris() # Load iris data set
We imported dataset, now let’s check the features and target(label)
print(iris.feature_names)
print(iris.target_names)
Output:
[‘sepal length (cm)’, ‘sepal width (cm)’, ‘petal length (cm)’, ‘petal width (cm)’]
[‘setosa’ ‘versicolor’ ‘virginica’]
Let us check the data in the index 0 from the dataset.
print(iris.data[0])
Output:
[5.1 3.5 1.4 0.2]
You can guess the answer by checking the above screenshot, the label value is Setosa
print(iris.target[0])
Target(Label) Output for the data[0] is:
0
The more accurate we come up with the feature, the accurate the result will be.
Next week, let us concentrate on TensorFlow, we train our Image classifier, the model is capable of recognising the name of the image based on the trained input data set.