In [13]:
from sklearn import datasets
from sklearn import metrics
from sklearn.tree import DecisionTreeClassifier
In [14]:
x = [[0, 0], [1, 1]]
y = [0, 1]
clf = tree.DecisionTreeClassifier()
clf = clf.fit(x, y)
In [15]:
clf.predict([[2., 2.]])
Out[15]:
In [16]:
clf.predict_proba([[2., 2.]])
Out[16]:
In [17]:
data = datasets.load_iris()
In [19]:
model = DecisionTreeClassifier()
model.fit(data.data, data.target)