bigframes.ml.metrics.recall_score#

bigframes.ml.metrics.recall_score(y_true: DataFrame | Series, y_pred: DataFrame | Series, *, average: str | None = 'binary') Series[source]#

Compute the recall.

The recall is the ratio tp / (tp + fn), where tp is the number of true positives and fn the number of false negatives. The recall is intuitively the ability of the classifier to find all the positive samples.

The best value is 1 and the worst value is 0.

Examples:

>>> import bigframes.pandas as bpd
>>> import bigframes.ml.metrics
>>> y_true = bpd.DataFrame([0, 1, 2, 0, 1, 2])
>>> y_pred = bpd.DataFrame([0, 2, 1, 0, 0, 1])
>>> recall_score = bigframes.ml.metrics.recall_score(y_true, y_pred, average=None)
>>> recall_score
0    1
1    0
2    0
dtype: int64
Parameters:
  • y_true (Series or DataFrame of shape (n_samples,)) – Ground truth (correct) target values.

  • y_pred (Series or DataFrame of shape (n_samples,)) – Estimated targets as returned by a classifier.

  • average ({'micro', 'macro', 'samples', 'weighted', 'binary'} or None, default='binary') – This parameter is required for multiclass/multilabel targets. Possible values are ‘None’, ‘micro’, ‘macro’, ‘samples’, ‘weighted’, ‘binary’. Only average=None is supported.

Returns:

Recall

of the positive class in binary classification or weighted average of the recall of each class for the multiclass task.

Return type:

float (if average is not None) or Series of float of shape n_unique_labels,)