added decision tree to suite
This commit is contained in:
parent
81f462740e
commit
5115d4c8a2
13
src/suite.py
13
src/suite.py
@ -28,6 +28,7 @@ from helpers.sift import getSiftData
|
|||||||
|
|
||||||
# Tests
|
# Tests
|
||||||
from helpers.test.knn import CVSuiteTestKNN
|
from helpers.test.knn import CVSuiteTestKNN
|
||||||
|
from helpers.test.decision_tree import CVSuiteTestDecisionTree
|
||||||
|
|
||||||
## UI config load
|
## UI config load
|
||||||
PROJECT_PATH = pathlib.Path(__file__).parent
|
PROJECT_PATH = pathlib.Path(__file__).parent
|
||||||
@ -98,6 +99,11 @@ class CVSuite:
|
|||||||
else:
|
else:
|
||||||
self.test_knn = None
|
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
|
# Load values from config after UI has been initialised
|
||||||
self.img_path.set(config_json["path"])
|
self.img_path.set(config_json["path"])
|
||||||
self.img_size.set(config_json["size"])
|
self.img_size.set(config_json["size"])
|
||||||
@ -304,6 +310,13 @@ class CVSuite:
|
|||||||
else:
|
else:
|
||||||
print(C_WARN, "KNN Model not configured!")
|
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")
|
output.configure(state="disabled")
|
||||||
|
|
||||||
def updatePath(self):
|
def updatePath(self):
|
||||||
|
Loading…
Reference in New Issue
Block a user