sip: Sip a brew

Description Usage Arguments Value Examples

View source: R/sip.R

Description

Sip a brew

Usage

1
2
3
4
5
6
7
8
9
sip(
  brew,
  from = "training",
  data_complete,
  fun_ctns_error = yardstick::rsq_vec,
  fun_intg_error = yardstick::rsq_vec,
  fun_bnry_error = yardstick::kap_vec,
  fun_catg_error = yardstick::kap_vec
)

Arguments

brew

an ipa_brew object.

from

column name for sipping. Valid options are training and testing. Inputs can be quoted (e.g. 'training') or unquoted (e.g. training).

data_complete

a data frame containing the 'true' values that were 'missing'.

fun_ctns_error

a function that will evaluate errors for continuous variables. Continuous variables have type double. Default is to use R-squared (see yardstick::rsq()).

fun_intg_error

a function that will evaluate errors for integer valued variables. Default is to use R-squared (see yardstick::rsq()).

fun_bnry_error

a function that will evaluate errors for binary variables (i.e., factors with 2 levels). Default is to use kappa agreement (see yardstick::kap()).

fun_catg_error

a function that will evaluate errors for categorical variables (i.e., factors with >2 levels). Default is to use kappa agreement (see yardstick::kap()).

Value

an ipa_brew object with a new column added to the wort. The new column contains a list of tibble::tibble()s with columns variable, type, and score. The score column comprises output from the error functions.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
data("diabetes")

df_miss <- diabetes$missing
df_cplt <- diabetes$complete

sft_brew <- brew_soft(df_miss, outcome = diabetes) %>%
  mash() %>%
  stir() %>%
  ferment() %>%
  bottle(type = 'tibble')


sip(sft_brew, from = training, data_complete = df_cplt)

bcjaeger/midy documentation built on May 3, 2020, 3:55 p.m.