Last active
April 6, 2020 05:54
-
-
Save monogenea/ca810670c01ceb9b6a249b4c6288b621 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Define targets and augment data | |
target <- model.matrix(~0+species) | |
targetTrain <- do.call("rbind", lapply(1:(dim(Xtrain)[1]/length(fnamesTrain)), | |
function(x) target[-c(valIdx, testIdx),])) | |
targetVal <- do.call("rbind", lapply(1:(dim(Xval)[1]/length(fnamesVal)), | |
function(x) target[valIdx,])) | |
targetTest <- do.call("rbind", lapply(1:(dim(Xtest)[1]/length(fnamesTest)), | |
function(x) target[testIdx,])) | |
# Assemble Xs and Ys | |
train <- list(X = Xtrain, Y = targetTrain) | |
val <- list(X = Xval, Y = targetVal) | |
test <- list(X = Xtest, Y = targetTest) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment