View source: R/construct_samplers.R
| construct_samplers | R Documentation |
Construct a list of samplers for synthesis
construct_samplers(
roadmap,
default_regression_sampler = NULL,
default_classification_sampler = NULL,
custom_samplers = NULL
)
roadmap |
A roadmap object |
default_regression_sampler |
A sampler function for regression models |
default_classification_sampler |
A sampler function for classification models |
custom_samplers |
A formatted list of sampler functions |
A named list of samplers
# construct_samplers() can create a sequence of samplers using a fully-default
# approach, a hybrid approach, or a fully-customized approach. All approaches
# require a roadmap and samplers.
rm <- roadmap(
conf_data = acs_conf_nw,
start_data = acs_start_nw
)
# Fully-default approach
construct_samplers(
roadmap = rm,
default_regression_sampler = sample_lm,
default_classification_sampler = sample_rpart
)
# Hybrid approach
construct_samplers(
roadmap = rm,
default_regression_sampler = sample_lm,
default_classification_sampler = sample_rpart,
custom_samplers = list(
list(vars = "hcovany", sampler = sample_rpart)
)
)
# Fully-customized approach
construct_samplers(
roadmap = rm,
custom_samplers = list(
list(vars = c("hcovany", "empstat", "classwkr"), sampler = sample_rpart),
list(vars = c("age", "famsize", "transit_time", "inctot"), sampler = sample_lm)
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.