Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
AlyaGomaa committed Dec 18, 2024
1 parent 2761482 commit 1a91f76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
7 changes: 3 additions & 4 deletions comparisons/flow_by_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,15 @@ class FlowByFlow(ComparisonMethod):
def init(self, args: list):
self.supported_tools: Tuple[str] = args[0]

def handle_flow_by_flow_comparison(self):
def compare(self):
self.log('', "-" * 30)
self.log("Comparison method: ", self.name)
self.log(' ', ' ')

# now apply this method to all supported tools
# apply this method to all supported tools
for tool in self.supported_tools:
# get the actual and predicted labels by the tool
calc = Calculator(tool, self.output_dir)

# get the actual and predicted labels by the tool
labels: Iterator = self.get_labels(tool)
cm: dict = calc.get_confusion_matrix(labels)
self.db.store_performance_errors_flow_by_flow(tool, cm)
Expand Down
2 changes: 1 addition & 1 deletion comparisons/per_timewindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def init(self, args: list):
self.supported_tools: Tuple[str] = args[0]
self.last_registered_tw: int = self.db.get_last_registered_timewindow()

def handle_per_tw_comparison(self):
def compare(self):
self.log('', "-" * 30)
self.log("Comparison method: ", self.name)
self.log(' ', ' ')
Expand Down
4 changes: 2 additions & 2 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@ def main(self):

FlowByFlow(self.output_dir,
self.supported_tools
).handle_flow_by_flow_comparison()
).compare()
PerTimewindow(self.output_dir,
self.supported_tools
).handle_per_tw_comparison()
).compare()

self.db.close()

Expand Down

0 comments on commit 1a91f76

Please sign in to comment.