bound: Truncates predictions to ensure loss function is bounded.

View source: R/utils.R

boundR Documentation

Truncates predictions to ensure loss function is bounded.

Description

Truncates predictions to ensure loss function is bounded.

Usage

bound(preds, bounds = 0.001)

Arguments

preds

A numeric vector of predictions to to be bounded.

bounds

Either a numeric vector of length two, giving the closed interval (lower, upper), or just a lower bound. In the latter case, the upper bound is computed as (1 - lower). The default is 0.001.

Value

Truncated predictions.


tlverse/sl3 documentation built on Nov. 18, 2024, 12:46 a.m.