Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix bug in model performence stats #382

Merged
merged 1 commit into from
Aug 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src_py/apiServer/stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,10 @@ def get_model_performence_stats(self , confusion_matrix_worker_dict , show : boo
workers_performence = OrderedDict()
for (worker_name, class_name) in confusion_matrix_worker_dict.keys():
workers_performence[(worker_name, class_name)] = OrderedDict()
tn, fp, fn, tp = confusion_matrix_worker_dict[(worker_name, class_name)].ravel()
matrix = confusion_matrix_worker_dict[(worker_name, class_name)]
if len(matrix.shape) == 1 or matrix.shape == (1, 1): # if the matrix is 1D or 1x1 skip to prevent errors in the calculations
continue
tn, fp, fn, tp = matrix.ravel()
if printStats:
LOG_INFO(f"worker {worker_name} class: {class_name} tn: {tn}, fp: {fp}, fn: {fn}, tp: {tp}")
tn = int(tn)
Expand Down