From 8a7059dfaddf1bdca71e0e3fab5eaa928f08f06f Mon Sep 17 00:00:00 2001 From: Lindsay Adams Date: Wed, 27 Nov 2024 17:34:18 -0800 Subject: [PATCH] Updated accuracy print --- theProject.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/theProject.py b/theProject.py index a36f595..64eb5d8 100644 --- a/theProject.py +++ b/theProject.py @@ -94,7 +94,8 @@ def evaluate(self, data:Data, classifier:Classifier, featureList = None): correct+= 1 accuracy = (correct / len(data.features)) #divide correct by total instances to get accuracy accuracy = round(accuracy, 4) - return accuracy + logging.info(f"{featureList} accuracy = {accuracy}") + class FeatureSearch: featureList = [] @@ -235,4 +236,4 @@ def printFeatureChange(featureChanged,currentFeatures,accuracy,add=True): dadi.loadFeatureList(featureList) classi.train(dadi) - print(vally.evaluate(dadi, classi, [2, 4, 6])) \ No newline at end of file + vally.evaluate(dadi, classi, [3, 5, 7]) \ No newline at end of file