rescale_curve: Rescale ROC/PR curves onto the same x-axis grid

View source: R/evaluator-lib-utils.R

rescale_curveR Documentation

Rescale ROC/PR curves onto the same x-axis grid

Description

A helper function to map a ROC/PR curve with unique coordinates given in a data.frame onto a new set of x-axis values (i.e., FPR for an ROC curve and recall for a PR curve).

Usage

rescale_curve(curve_data, x_grid, xvar, yvar)

Arguments

curve_data

A data.frame containing the x- and y-coordinates that define the ROC/PR curve.

x_grid

Vector of x-coordinates at which to evaluate ROC/PR curve

xvar

Name of column in curve_data with the FPR values for an ROC curve or the recall values for a PR curve.

yvar

Name of column in curve_data with the TPR values for an ROC curve or the precision values for a PR curve.

Value

A data.frame with the coordinates of the ROC/PR curve using the new x-axis scale. This data.frame has two columns with names given by those specified in xvar and yvar.


Yu-Group/simChef documentation built on March 25, 2024, 3:22 a.m.