Description Usage Arguments Value Examples
If you use Rstudio, the masher
and spicer
functions can help
remind you which parameters go along with which ipa_brew
flavor.
The basic idea is to write spice(brew, with = spicer_<flavor>())
and mash(brew, with = masher_<flavor>())
. Hitting the tab key with
your curser inside the parentheses of masher_flavor()
will create a
drop-down menu that shows a list of the arguments that go along with
your brew's flavor.
If you have no trouble remembering the parameters that go along
with your brew's flavor, or if you just want your code to be more concise,
you don't have to use the with
argument. Instead, you can just
specify parameter values directly using the ...
argument in the mash
and spice
functions. In the examples below, both approaches are shown.
1 2 3 4 5 6 7 | spicer_soft(
rank_max_init = 2L,
rank_max_ovrl = NULL,
rank_stp_size = 1L,
lambda = NULL,
grid = FALSE
)
|
rank_max_init |
an integer value that restricts the rank of the
solution for the first |
rank_max_ovrl |
an integer value that restricts the rank of the
solution for all |
rank_stp_size |
an integer value that indicates how much the maximum
rank of |
lambda |
nuclear-norm regularization parameter. If |
grid |
a logical value. If |
a list with input values that can be passed directly into
spice, e.g spice(brew, with = spicer_nbrs())
for a neighbors
brew or spice(brew, with = spicer_soft())
for a soft brew.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.