autointent.metrics.regex.regex_partial_precision#
- autointent.metrics.regex.regex_partial_precision(y_true, y_pred)#
Calculate regex partial precision.
The regex partial precision is calculated as:
where:
is the total number of samples, is the true label for the -th sample, is the predicted label for the -th sample, is the number of predicted labels for the -th sample, is the indicator function that equals 1 if the condition is true and 0 otherwise.
- Parameters:
y_true (autointent.metrics.custom_types.LABELS_VALUE_TYPE) – True values of labels.
y_pred (autointent.metrics.custom_types.LABELS_VALUE_TYPE) – Predicted values of labels.
- Returns:
Score of the regex partial precision.
- Return type: