I am trying to write a custom categorical loss function using single y_true and y_pred of multiple records sharing the same email address based on the following