Metrics#

The following performance metric functions are supported in USEncrypt.ai:

accuracy_score

Computes the accuracy score between labels and predictions.

binary_cross_entropy

Computes the binary cross-entropy between labels and predictions.

categorical_cross_entropy

Computes the cross-entropy between labels and predictions.

confusion_matrix

Generates a confusion matrix based on ground-truth and prediction labels.

f1_score

Computes the F1 score.

mean_squared_error

Computes the mean squared error between labels and predictions.

precision_score

Computes the precision score, calculated as the ratio \(\frac{\text{TP}}{(\text{TP} + \text{FP})}\), where \(\text{TP}\) is the number of true positives and \(\text{FP}\) is the number of false positives.

recall_score

Computes the recall score, calculated as the ratio \(\frac{\text{TP}}{(\text{TP} + \text{FN})}\) where \(\text{TP}\) is the number of true positives and \(\text{FN}\) is the number of false negatives.

save_metrics

Saves the performance metrics used in classification to a JSON file.