-
Notifications
You must be signed in to change notification settings - Fork 7
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
New confusion natrix #392
New confusion natrix #392
Conversation
src_py/apiServer/stats.py
Outdated
|
||
if has_multiple_max: | ||
LOG_INFO(f"Worker {worker_name} has at least one sample with multiple predicted labels") | ||
#max_column_predict_index = is_max.apply(lambda row: list(row[row].index), axis=1).tolist() # Generate a list of lists' each sublist has the index of the maximum value in the row |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this line is commented out. Decide to remove or to add it with condition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it.
max_column_predict_index =[[int(predict_label) - num_of_labels for predict_label in prdict_indexes_sublist] for prdict_indexes_sublist in max_column_predict_index] # fix the index to original labels index | ||
max_column_labels_index = df_worker_labels.iloc[:, :num_of_labels].idxmax(axis=1).tolist() # Get the index of the maximum actual value in each row | ||
|
||
else: # No sample with multiple predicted labels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What does it mean No sample?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that means that in each sample there is only 1 predicted label
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand why no sample.
src_py/apiServer/stats.py
Outdated
max_column_labels_index = df_worker_labels.iloc[:, :num_of_labels].idxmax(axis=1).tolist() # Get the index of the maximum actual value in each row | ||
|
||
else: # No sample with multiple predicted labels | ||
# Take 2 list from the df, one for the actual labels and one for the predict labels to build the confusion matrix |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Typo - lists
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
src_py/apiServer/stats.py
Outdated
class_predict_list = [1 if label_num == class_index else 0 for label_num in max_column_predict_index] # 1 if the label is belong to the class, 0 otherwise | ||
confusion_matrix = metrics.confusion_matrix(class_actual_list, class_predict_list) | ||
labels = [0, 1] | ||
confusion_matrix = metrics.confusion_matrix(class_actual_list, class_predict_list, labels=labels) | ||
#confusion_matrix_np = confusion_matrix.to_numpy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Decide - Remove if not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I removed it.
max_column_predict_index =[[int(predict_label) - num_of_labels for predict_label in prdict_indexes_sublist] for prdict_indexes_sublist in max_column_predict_index] # fix the index to original labels index | ||
max_column_labels_index = df_worker_labels.iloc[:, :num_of_labels].idxmax(axis=1).tolist() # Get the index of the maximum actual value in each row | ||
|
||
else: # No sample with multiple predicted labels |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still don't understand why no sample.
fixing bugs