makekWayCrossValidationGroupedByColumn | R Documentation |
Build a k-fold cross validation splitter, respecting (never splitting) groupingColumn.
makekWayCrossValidationGroupedByColumn(groupingColumnName)
groupingColumnName |
name of column to group by. |
splitting function in the sense of vtreat::buildEvalSets.
d <- data.frame(y=sin(1:100))
d$group <- floor(seq_len(nrow(d))/5)
splitter <- makekWayCrossValidationGroupedByColumn('group')
split <- splitter(nrow(d),5,d,d$y)
d$splitLabel <- vtreat::getSplitPlanAppLabels(nrow(d),split)
rowSums(table(d$group,d$splitLabel)>0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.