Learn R Programming

tune (version 1.0.0)

.use_case_weights_with_yardstick: Determine if case weights should be passed on to yardstick

Description

This S3 method defines the logic for deciding when a case weight vector should be passed to yardstick metric functions and used to measure model performance. The current logic is that frequency weights (i.e. hardhat::frequency_weights()) are the only situation where this should occur.

Usage

.use_case_weights_with_yardstick(x)

# S3 method for hardhat_importance_weights .use_case_weights_with_yardstick(x)

# S3 method for hardhat_frequency_weights .use_case_weights_with_yardstick(x)

Value

A single TRUE or FALSE.

Arguments

x

A vector

Examples

Run this code
library(parsnip)
library(dplyr)

frequency_weights(1:10) %>%
  .use_case_weights_with_yardstick()

importance_weights(seq(1, 10, by = .1))%>%
  .use_case_weights_with_yardstick()

Run the code above in your browser using DataLab