import sys
from time import time
sys.path.append("../tools/")
from email_preprocess import preprocess


### features_train and features_test are the features for the training
### and testing datasets, respectively
### labels_train and labels_test are the corresponding item labels
features_train, features_test, labels_train, labels_test = preprocess()




#########################################################
### your code goes here ###

from sklearn import tree
clf = tree.DecisionTreeClassifier(min_samples_split=40)
clf.fit(features_train,labels_train)

pred = clf.predict(features_test)
from sklearn.metrics import accuracy_score

acc = accuracy_score(pred, labels_test)
print (acc)
print (len(features_train[0]))
#########################################################