Update Forest Parameters
Arguments
- object
(ObliqueForest) an oblique random forest object (see orsf).
- ...
arguments to plug into orsf that will be used to define the update. These arguments include:
dataformulacontrolweightsn_treen_splitn_retryn_threadmtrysample_with_replacementsample_fractionleaf_min_eventsleaf_min_obssplit_rulesplit_min_eventssplit_min_obssplit_min_statpred_typeoobag_pred_horizonoobag_eval_everyoobag_funimportanceimportance_max_pvaluegroup_factorstree_seedsna_actionverbose_progress
Note that you can update
control, but you cannot change the type of forest. For example, you can't go from classification to regression withorsf_update.- modify_in_place
(logical) if
TRUE,objectwill be modified by the inputs specified in.... Be cautious, as modification in place will overwrite existing data. IfFALSE(the default),objectwill be copied and then the modifications will be applied to the copy, leaving the originalobjectunmodified.- no_fit
(logical) if
TRUE, model fitting steps are defined and saved, but training is not initiated. The object returned can be directly submitted toorsf_train()so long asattach_dataisTRUE.
Details
There are several dynamic inputs in orsf with default values of NULL.
Specifically, these inputs are control, weights, mtry, split_rule,
split_min_stat, pred_type, pred_horizon, oobag_eval_function,
tree_seeds, and oobag_eval_every. If no explicit value is given for
these inputs in the call, they will be re-formed. For example, if
an initial forest includes 17 predictors, the default mtry is the
smallest integer that is greater than or equal to the square root of 17,
i.e., 5. Then, if you make an updated forest with 1 less predictor and
you do not explicitly say mtry = 5, then mtry will be re-initialized
in the update based on the available 16 predictors, and the resulting
value of mtry will be 4. This is done to avoid many potential errors
that would occur if the dynamic outputs were not re-initialized.
Examples
if (FALSE) { # \dontrun{
# initial fit has mtry of 5
fit <- orsf(pbc_orsf, time + status ~ . -id)
# note that mtry is now 4 (see details)
fit_new <- orsf_update(fit, formula = . ~ . - edema, n_tree = 100)
# prevent dynamic updates by specifying inputs you want to freeze.
fit_newer <- orsf_update(fit_new, mtry = 2)
} # }
