View source: R/other-functions.R
| fn.folds_by_observation | R Documentation |
In a bootstrap sample the same original observation appears more than once.
Assigning folds row by row would place copies of one observation in different
folds, so a forest would train on one copy and predict another and the
prediction would not be out of sample. This assigns one fold per distinct
original observation, stratified by (S,Z) cell so every fold still sees all
K \times J study-group combinations, and gives every copy that fold.
fn.folds_by_observation(data, orig_idx, n_folds = 5L)
data |
Structured data list for the (possibly resampled) data |
orig_idx |
Integer vector (length N) of original row numbers, i.e.
|
n_folds |
Number of folds (default 5) |
Integer vector of fold assignments (length N)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.