disabled tree plotting; added tree files to .gitignore

This commit is contained in:
s452645 2021-06-06 18:29:02 +02:00
parent e84e71529f
commit 7a5ce8d1cd
2 changed files with 8 additions and 8 deletions

2
.gitignore vendored
View File

@ -142,4 +142,4 @@ dmypy.json
cython_debug/ cython_debug/
# local sandbox # local sandbox
sandbox/ sandbox

View File

@ -40,12 +40,12 @@ class DecisionTree:
print(tree.export_text(self.clf, feature_names=self.vec.get_feature_names())) print(tree.export_text(self.clf, feature_names=self.vec.get_feature_names()))
# plot a tree (not necessary) # plot a tree (not necessary)
fig = pyplot.figure(figsize=(50, 40)) # fig = pyplot.figure(figsize=(50, 40))
_ = tree.plot_tree(self.clf, # _ = tree.plot_tree(self.clf,
feature_names=self.vec.get_feature_names(), # feature_names=self.vec.get_feature_names(),
class_names=self.clf.classes_, # class_names=self.clf.classes_,
filled=True) # filled=True)
fig.savefig("decistion_tree.png") # fig.savefig("decistion_tree.png")
def save(self): def save(self):
dump(self.clf, 'decision_tree.joblib') dump(self.clf, 'decision_tree.joblib')
@ -88,4 +88,4 @@ if __name__ == "__main__":
decision_tree = DecisionTree() decision_tree = DecisionTree()
decision_tree.build("training_set.txt", 15) decision_tree.build("training_set.txt", 15)
decision_tree.test() decision_tree.test()
# decision_tree.save() decision_tree.save()