bigframes.ml.metrics.roc_curve#

bigframes.ml.metrics.roc_curve(y_true:DataFrame|Series,y_score:DataFrame|Series,*,drop_intermediate:bool=True)Tuple[Series,Series,Series][source]#

Compute Receiver operating characteristic (ROC).

Examples:

>>>importbigframes.pandasasbpd>>>importbigframes.ml.metrics
>>>y_true=bpd.DataFrame([1,1,2,2])>>>y_score=bpd.DataFrame([0.1,0.4,0.35,0.8])>>>fpr,tpr,thresholds=bigframes.ml.metrics.roc_curve(y_true,y_score,drop_intermediate=False)>>>fpr0    0.01    0.02    0.03    0.04    0.0Name: fpr, dtype: Float64
>>>tpr0         0.01    0.3333332         0.53    0.8333334         1.0Name: tpr, dtype: Float64
>>>thresholds0     inf1     0.82     0.43    0.354     0.1Name: thresholds, dtype: Float64
Parameters:
  • y_true – Series or DataFrame of shape (n_samples,)True binary labels. If labels are not either {-1, 1} or {0, 1}, thenpos_label should be explicitly given.

  • y_score – Series or DataFrame of shape (n_samples,)Target scores, can either be probability estimates of the positiveclass, confidence values, or non-thresholded measure of decisions(as returned by “decision_function” on some classifiers).

  • drop_intermediate – bool, default=TrueDefault to True. Whether to drop some suboptimal thresholds which would not appearon a plotted ROC curve. This is useful in order to create lighterROC curves.

Returns:

Increasing false positive rates such that element i is the false

positive rate of predictions with score >=thresholds[i].

tpr:

Increasing true positive rates such that elementi is the truepositive rate of predictions with score >=thresholds[i].

thresholds:

Decreasing thresholds on the decision function used to computefpr and tpr.thresholds[0] represents no instances being predictedand is arbitrarily set tomax(y_score) + 1.

Return type:

fpr

On this page

This Page