You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
with open(filename + '_train', 'w') as train, open(filename + '_validate', 'w') as test:
for line in infile:
if random.random() > treshold:
test.write(line)
else:
train.write(line)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('input', help='path to the input file', type=str)
parser.add_argument('-t', '--treshold', help='between 0 and 1, the training set will always be the bigger one, i.e. 0.2 and 0.8 are equivalent', type=float, default=0.8)