Description Usage Arguments Value Further Details Examples
View source: R/calcKFoldError.R
Generic method for creating KFold testing data
1 | createKFoldData(score_ids, full_data, pred_df)
|
score_ids |
Vector of row ids to be included in scoring data |
full_data |
Complete dataset (class 'hpidata“) of this model type (rt or hed) |
pred_df |
Data to be used for prediction |
list of length 2 containing:
Training data.frame
Scoring data.frame
Called from 'calcKFoldError()“
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | # Load Data
data(ex_sales)
# Create RT Data
rt_data <- rtCreateTrans(trans_df = ex_sales,
prop_id = 'pinx',
trans_id = 'sale_id',
price = 'sale_price',
periodicity = 'monthly',
date = 'sale_date')
# Create folds
k_folds <- split(x = 1:nrow(rt_data),
f = sample(1:10, nrow(rt_data), replace = TRUE))
# Create data from folds
kfold_data <- createKFoldData(score_ids = k_folds[[1]],
full_data = rt_data,
pred_df = rt_data)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.