bigframes.ml.metrics.auc#
- bigframes.ml.metrics.auc(x: DataFrame | Series, y: DataFrame | Series) float[source]#
Compute Area Under the Curve (AUC) using the trapezoidal rule.
This is a general function, given points on a curve. For computing the area under the ROC-curve, see
roc_auc_score(). For an alternative way to summarize a precision-recall curve, seeaverage_precision_score().Examples:
>>> import bigframes.pandas as bpd >>> import bigframes.ml.metrics
>>> x = bpd.DataFrame([1, 1, 2, 2]) >>> y = bpd.DataFrame([2, 3, 4, 5]) >>> auc = bigframes.ml.metrics.auc(x, y) >>> auc np.float64(3.5)
The input can be Series:
>>> df = bpd.DataFrame( ... {"x": [1, 1, 2, 2], ... "y": [2, 3, 4, 5],} ... ) >>> auc = bigframes.ml.metrics.auc(df["x"], df["y"]) >>> auc np.float64(3.5)