parsnip_model | R Documentation |
parsnip
modelsparsnip_model(model_spec, save_path)
model_spec |
A |
save_path |
Directory to save models. Set to |
Specify that the models should be fit using a classification model specified with the parsnip
package.
Warning: This functionality is experimental and not recommended for use in analyses.
sqrt{n}
-consistency estimation and valid inference of the parameters in marginal structural models for
emulated trials generally require that the weights for treatment switching and censoring be estimated at parametric
rates, which is generally not possible when using data-adaptive estimation of high-dimensional regressions.
Therefore, we only recommend using stats_glm_logit()
.
An object of class te_parsnip_model
inheriting from te_model_fitter which is used for
dispatching methods for the fitting models.
Other model_fitter:
stats_glm_logit()
,
te_model_fitter-class
## Not run:
if (
requireNamespace("parsnip", quietly = TRUE) &&
requireNamespace("rpart", quietly = TRUE)
) {
# Use a decision tree model fitted with the rpart package
parsnip_model(
model_spec = parsnip::decision_tree(tree_depth = 30) |>
set_mode("classification") |>
set_engine("rpart"),
save_path = tempdir()
)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.