Created
March 22, 2019 08:21
-
-
Save holysoros/c3b60ec62607bf33dcc2f7aa3cb23a7a to your computer and use it in GitHub Desktop.
Split data file into train and valid part.
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
#!/usr/bin/env bash | |
shuf $1 >random.txt | |
linenum=`wc -l random.txt | awk '{print $1}'` | |
validnum=$(($linenum/10)) | |
trainnum=$(($validnum*9)) | |
head -n $trainnum random.txt > notes.train | |
head -n $validnum random.txt > notes.valid | |
rm random.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment