From 5115d4c8a22ee3b31f1d9bc6040bb8e73a619039 Mon Sep 17 00:00:00 2001 From: Tom Selier Date: Sat, 21 Oct 2023 17:41:23 +0200 Subject: [PATCH] added decision tree to suite --- src/suite.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/suite.py b/src/suite.py index 0e5e436..d58df78 100644 --- a/src/suite.py +++ b/src/suite.py @@ -28,6 +28,7 @@ from helpers.sift import getSiftData # Tests from helpers.test.knn import CVSuiteTestKNN +from helpers.test.decision_tree import CVSuiteTestDecisionTree ## UI config load PROJECT_PATH = pathlib.Path(__file__).parent @@ -98,6 +99,11 @@ class CVSuite: else: self.test_knn = None + if config_json["models"]["dectree"] != "": + self.test_dectree = CVSuiteTestDecisionTree(config_json["models"]["dectree"]) + else: + self.test_dectree = None + # Load values from config after UI has been initialised self.img_path.set(config_json["path"]) self.img_size.set(config_json["size"]) @@ -304,6 +310,13 @@ class CVSuite: else: print(C_WARN, "KNN Model not configured!") + if self.test_dectree is not None: + print(self.test_dectree.predict(data)) + output.insert("end", "Decision Tree Result:\n") + pass + else: + print(C_WARN, "Decison Tree Model not configured!") + output.configure(state="disabled") def updatePath(self):