Ejemplo n.º 1
0
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])
Ejemplo n.º 2
0
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))