cal_apply: Applies a calibration to a set of existing predictions

View source: R/cal-apply.R

cal_applyR Documentation

Applies a calibration to a set of existing predictions

Description

Applies a calibration to a set of existing predictions

Usage

cal_apply(.data, object, pred_class = NULL, parameters = NULL, ...)

## S3 method for class 'data.frame'
cal_apply(.data, object, pred_class = NULL, parameters = NULL, ...)

## S3 method for class 'tune_results'
cal_apply(.data, object, pred_class = NULL, parameters = NULL, ...)

## S3 method for class 'cal_object'
cal_apply(.data, object, pred_class = NULL, parameters = NULL, ...)

Arguments

.data

An object that can process a calibration object.

object

The calibration object (cal_object).

pred_class

(Optional, classification only) Column identifier for the hard class predictions (a factor vector). This column will be adjusted based on changes to the calibrated probability columns.

parameters

(Optional) An optional tibble of tuning parameter values that can be used to filter the predicted values before processing. Applies only to tune_results objects.

...

Optional arguments; currently unused.

Details

cal_apply() currently supports data.frames only. It extracts the truth and the estimate columns names from the calibration object.

See Also

https://www.tidymodels.org/learn/models/calibration/, cal_estimate_beta(), cal_estimate_isotonic(), cal_estimate_isotonic_boot(), cal_estimate_linear(), cal_estimate_logistic(), cal_estimate_multinomial()

Examples


# ------------------------------------------------------------------------------
# classification example

w_calibration <- cal_estimate_logistic(segment_logistic, Class)

cal_apply(segment_logistic, w_calibration)

topepo/probably documentation built on Oct. 21, 2024, 3:28 a.m.