From 7a5ce8d1cdb50fe9c20225cc5b08460dbf2a0d6b Mon Sep 17 00:00:00 2001 From: s452645 Date: Sun, 6 Jun 2021 18:29:02 +0200 Subject: [PATCH] disabled tree plotting; added tree files to .gitignore --- .gitignore | 2 +- algorithms/learn/decision_tree.py | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.gitignore b/.gitignore index ef08f9b..f64d297 100644 --- a/.gitignore +++ b/.gitignore @@ -142,4 +142,4 @@ dmypy.json cython_debug/ # local sandbox -sandbox/ +sandbox \ No newline at end of file diff --git a/algorithms/learn/decision_tree.py b/algorithms/learn/decision_tree.py index b985a8c..05defda 100644 --- a/algorithms/learn/decision_tree.py +++ b/algorithms/learn/decision_tree.py @@ -40,12 +40,12 @@ class DecisionTree: print(tree.export_text(self.clf, feature_names=self.vec.get_feature_names())) # plot a tree (not necessary) - fig = pyplot.figure(figsize=(50, 40)) - _ = tree.plot_tree(self.clf, - feature_names=self.vec.get_feature_names(), - class_names=self.clf.classes_, - filled=True) - fig.savefig("decistion_tree.png") + # fig = pyplot.figure(figsize=(50, 40)) + # _ = tree.plot_tree(self.clf, + # feature_names=self.vec.get_feature_names(), + # class_names=self.clf.classes_, + # filled=True) + # fig.savefig("decistion_tree.png") def save(self): dump(self.clf, 'decision_tree.joblib') @@ -88,4 +88,4 @@ if __name__ == "__main__": decision_tree = DecisionTree() decision_tree.build("training_set.txt", 15) decision_tree.test() - # decision_tree.save() + decision_tree.save()