What is decision tree classifier? Exactly!

Hi, I’m noob to machine learning, just I was going through Google’s Machine Learning recipes videos, in which I came up with something called as DecisionTreeClassifier. The things which I didn’t understood there is that he used an example of deciding a fruit based on features.

The features used in the example are as follows : Weight, Texture

The code is as follows :

from sklearn import tree

# Here 0 indicates texture (bumpy) and 1 indicates texture (plain)
features = [[ 140, 1 ] [ 130, 1 ] [ 150, 0 ] [ 170, 0 ]]

# Here 0 indicates fruit (orange) and 1 indicates fruit (apple)
labels = [0, 0, 1, 1]

clf = tree.DecisionTreeClassifier()
clf = clf.fit(features, labels)
print clf.predict([[150, 0]])

My question is that,

Where the machine is actually learning and where the learnt data is saved?

And on what bases machine is deciding the fruit type?

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.