View source: R/prtree_control.R
| pr_tree_control_cv | R Documentation |
Creates a list of control parameters for Probabilistic Regression Trees. The base function pr_tree_control returns parameters for tree construction. The extended function pr_tree_control_cv returns both tree parameters and cross-validation settings.
pr_tree_control_cv(method = "montecarlo", n_rep = 10, only_sigma = FALSE,
prop_test = 0.2, prop_valid = 0.2, stratify = FALSE,
update_final = TRUE, fold_idx = NULL, ...)
method |
Character. Cross-validation method: either |
n_rep |
Integer. Number of folds for |
only_sigma |
Logical. If
|
prop_test |
Numeric between 0 and 1. Proportion of data for the test set in Monte Carlo CV. Default is 0.2.
|
prop_valid |
Numeric between 0 and 1. Proportion of the training set to
use for validation (
|
stratify |
Logical. If |
update_final |
Logical. If |
fold_idx |
Integer. Optional. A numeric vector with fold numbers (from 1
to |
... |
Control parameters for PRTree. See pr_tree_control |
Choosing the right configuration:
| Goal | Method | Parameters |
| Estimate sigma + test error | any | prop_valid > 0, only_sigma = FALSE |
| Test error only (sigma known) | any | prop_valid = 0, only_sigma = FALSE |
| Sigma selection only | montecarlo | prop_test = 0, only_sigma = TRUE |
| Sigma selection only | kfold | only_sigma = TRUE |
A list of class prtree.control_cv containing merged with
cross-validation settings
pr_tree for fitting a single tree,
pr_tree_cv for cross-validation.
# Default Monte Carlo CV
cv1 <- pr_tree_control_cv()
# Monte Carlo CV with custom parameters
cv2 <- pr_tree_control_cv(
method = "montecarlo",
n_rep = 20,
prop_test = 0.3,
prop_valid = 0.2,
stratify = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.