Ejemplo n.º 1
0
def TIME(filename, old):
    stop = 0.9

    read = MAR()
    read = read.create(filename)
    read.create_old(old)
    num2 = read.get_allpos()
    target = int(num2 * stop)
    while True:
        pos, neg, total = read.get_numbers()
        # print("%d/ %d" % (pos,pos+neg))
        if pos >= target:
            break
        a, b, ids, c = read.train_kept()
        for id in ids:
            read.code(id, read.body["label"][id])
    return read
Ejemplo n.º 2
0
def TIME_START(filename):
    stop = 0.9

    read = MAR()
    read = read.create(filename)
    num2 = read.get_allpos()
    target = int(num2 * stop)
    while True:
        pos, neg, total = read.get_numbers()
        # print("%d/ %d" % (pos,pos+neg))
        if pos >= target:
            break
        if pos == 0:
            for id in read.random():
                read.code(id, read.body["label"][id])
        else:
            a, b, ids, c = read.train_kept()
            for id in ids:
                read.code(id, read.body["label"][id])
    return read