spice: Spice a brew

Description Usage Arguments Value Examples

View source: R/spice.R

Description

When an ipa_brew is spiced, tuning parameters are designated and saved in the pars component of the brew.

Usage

1

Arguments

brew

an ipa_brew object.

with

a helper function for mashing brews. See spicer_nbrs and spicer_soft)

...

additional arguments for specific brew flavors.

Value

an ipa_brew object with values added to pars.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
data <- data.frame(
  x1 = 1:10,
  x2 = 10:1,
  x3 = rnorm(10),
  outcome = 11 + runif(10)
)

data[1:2, 1:2] = NA

knn_brew <- brew(data, outcome = outcome, flavor = 'kneighbors')
sft_brew <- brew(data, outcome = outcome, flavor = 'softImpute')

# these two calls are equivalent
spicy_knn <- spice(knn_brew, with = spicer_nbrs(k_neighbors = c(3, 5)))
spicy_knn <- spice(knn_brew, k_neighbors = c(3, 5))

# these two calls are equivalent
spicy_sft <- spice(sft_brew, with = spicer_soft(grid = TRUE))
spicy_sft <- spice(sft_brew, grid = TRUE)

bcjaeger/ipa documentation built on May 7, 2020, 9:45 a.m.