Created
April 3, 2015 13:23
-
-
Save JasYoung315/8fe7fd58295f65957ace to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dtree = DecisionTreeClassifier(max_depth = 4) | |
dtree.fit(data_data, data_target) | |
scores = cross_validation.cross_val_score(dtree, data_data, data_target, cv=10) | |
print scores | |
print dtree.score(data_data, data_target) | |
from StringIO import StringIO | |
from inspect import getmembers | |
out = StringIO() | |
out = tree.export_graphviz(dtree, feature_names=names_of_attributes, out_file='tree_data.dot') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment