This file contains 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
#Randomly shuffle the data | |
yourdata<-yourdata[sample(nrow(yourdata)),] | |
#Create 10 equally size folds | |
folds <- cut(seq(1,nrow(yourdata)),breaks=10,labels=FALSE) | |
#Perform 10 fold cross validation | |
for(i in 1:10){ | |
#Segement your data by fold using the which() function | |
testIndexes <- which(folds==i,arr.ind=TRUE) | |
testData <- yourdata[testIndexes, ] | |
trainData <- yourdata[-testIndexes, ] |
This file contains 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
#include <stdint.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
// munged from https://github.com/simontime/Resead | |
namespace sead | |
{ | |
class Random | |
{ |