Permalink
Browse files

script updates

  • Loading branch information...
1 parent 4a9f2cb commit c84210f7b900d00b9fe4880303a08ed59b55baf5 @hmason committed Feb 17, 2012
Showing with 7 additions and 4 deletions.
  1. +6 −3 solving_problems/liked_decision_tree.py
  2. +1 −1 solving_problems/simhashes.py
@@ -14,9 +14,12 @@
data_features.append([row[0], row[1]])
data_labels.append(row[2])
- dt = tree.DecisionTreeClassifier()
+ # sklearn.tree.DecisionTreeClassifier(criterion='gini', max_depth=None, min_split=1,
+ # min_density=0.10000000000000001, max_features=None, compute_importances=False, random_state=None)
+
+ dt = tree.DecisionTreeClassifier(min_split=10)
dt = dt.fit(data_features, data_labels)
- # print dt.predict([12,5])
+ print dt.predict([50,500])
- # o = tree.export_graphviz(dt,out_file='thingiverse_tree.dot',feature_names=['user_id','num_likes'])
+ o = tree.export_graphviz(dt,out_file='thingiverse_tree.dot',feature_names=['user_id','num_likes'])
@@ -2,6 +2,7 @@
if __name__ == '__main__':
f = open('flat.txt', 'r')
+ #f = open('thingiverse_all_names.csv')
data = [line.strip() for line in f.readlines()]
f.close()
@@ -12,4 +13,3 @@
print "%s %s" % (k, h)
print all_hashes['Flatpack Bunny'].similarity(h)
-

0 comments on commit c84210f

Please sign in to comment.