Function to fit a 10 fold cross validated ML model. Currently only support binomial data.
1 2 |
points |
A data.frame or sfc object containing 'n_trials', 'n_positive' fields |
layer_names |
Names of column corresponding covariates to use |
model_type |
Either 'randomForest', in which case a random forest |
k |
The number of folds to use |
fix_cov |
If wishing to fix the values of any covariates when producing fitted values, specify as list with 2 elements 'cov_name' and 'cov_val' e.g. fix_cov = list(cov_name = 'x', cov_val = 1) using the ranger package is fit or 'hal', in which case a highly adaptive lasso using the hal9001 package is fit. Note the 'hal' is computationally expensive and not recommended for large (>200) datasets. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.