In [13]:
from sklearn import datasets
from sklearn import metrics
from sklearn.tree import DecisionTreeClassifier

Testing out decision trees to see if they may be useful with these data.


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]:
array([1])

In [16]:
clf.predict_proba([[2., 2.]])


Out[16]:
array([[ 0.,  1.]])

In [17]:
data = datasets.load_iris()

In [19]:
model = DecisionTreeClassifier()
model.fit(data.data, data.target)


DecisionTreeClassifier(class_weight=None, criterion='gini', max_depth=None,
            max_features=None, max_leaf_nodes=None, min_samples_leaf=1,
            min_samples_split=2, min_weight_fraction_leaf=0.0,
            presort=False, random_state=None, splitter='best')