Created
July 15, 2016 15:02
-
-
Save albertotb/1bad123363b186267e3aeaa26610b54b 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
if __name__ == "__main__": | |
if len(sys.argv) < 3 or len(sys.argv) > 4: | |
print "usage: {0} TRAIN TEST VAL".format(sys.argv[0]) | |
sys.exit(1) | |
train = np.loadtxt(sys.argv[1]) | |
test = np.loadtxt(sys.argv[2]) | |
val = np.loadtxt(sys.argv[3]) | |
ntrain = train.shape[0] | |
nval = val.shape[0] | |
train = np.concatenate((train, val)) | |
test_fold = -1*np.ones(ntrain+nval) | |
test_fold[ntrain:] = 0 | |
cv = PredefinedSplit(test_fold) | |
# you can pass the object cv to functions such as GridSearchCV |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment