projects
/
agghoo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Some fixes + refactoring
[agghoo.git]
/
R
/
utils.R
diff --git
a/R/utils.R
b/R/utils.R
index
fa3a9df
..
823b123
100644
(file)
--- a/
R/utils.R
+++ b/
R/utils.R
@@
-1,3
+1,4
@@
+# Helper for cross-validation: return the next test indices.
get_testIndices <- function(n, CV, v, shuffle_inds) {
if (CV$type == "vfold") {
# Slice indices (optionnally shuffled)
get_testIndices <- function(n, CV, v, shuffle_inds) {
if (CV$type == "vfold") {
# Slice indices (optionnally shuffled)
@@
-13,6
+14,7
@@
get_testIndices <- function(n, CV, v, shuffle_inds) {
test_indices
}
test_indices
}
+# Helper which split data into training and testing parts.
splitTrainTest <- function(data, target, testIdx) {
dataTrain <- data[-testIdx,]
targetTrain <- target[-testIdx]
splitTrainTest <- function(data, target, testIdx) {
dataTrain <- data[-testIdx,]
targetTrain <- target[-testIdx]