def main(): loaded = stream.load(sys.stdin) merged = makehash() for k1 in loaded: merged[k1] = SemiMarkov() for k2 in loaded[k1]: merged[k1] += loaded[k1][k2] stream.dump(k1, merged[k1])
def dship(table_file, **kwargs): """Build models from dshiped table file """ chained = chain_files(table_file) loaded = stream.load(chained) basename = '-'.join(os.path.basename(f).split('.')[0] for f in table_file) for k1 in loaded: for k2 in loaded[k1]: assert k2 == 'NULL' model = loaded[k1][k2] save_model(model, 'data/%s_%s.model' % (basename, k1))