def get_train_data():
    all_preds = [
            "data/cv.ins5.ffm.out",
            "data/xgb5_train.out",
            "data/cv.ins_bag.ffm.out",
            "data/cv.ins5.fm.out",
            "data/cv.ins3.ffm.out",
            "data/cv.ins20.ffm.out",
            "data/xgb3_train.out",

            "data/cv.ins.ffm.out",
            "data/cv.ins2.ffm.out",
            ]
    tr_X, tr_y_true = [], []
    tr_loss, te_loss = 0.0, 0.0
    te_X, te_y_true = [], []
    avg_ctr = 0
    loss = 0
    delta = 1
    now = datetime.now()

    random.seed(9)
    for t, (y, preds) in enumerate(izip(read_true(), read_preds(all_preds))):
        avg_p = stack_preds(preds)
        avg_ctr += avg_p
        l = logloss(avg_p, y)
        if t < 5000000:
            if "nn3" > args.model:
                preds = map(lambda x : relogit(x), preds)
            elif "nn" in args.model:
                preds = map(lambda x : relogit(x) + (random.random() - 0.5) / 10, preds)
            elif "xgb" in args.model:
                preds = map(lambda x : relogit(x) + (random.random() - 0.5) / 10, preds)
            tr_X.append(preds)
            tr_y_true.append(y)
            tr_loss += l
        else:
            preds = map(lambda x : relogit(x), preds)
            te_X.append(preds)
            te_y_true.append(y)
            te_loss += l
        loss += l
        if t == delta:
            print "%s: %s loss: %s"%(t, datetime.now() - now, loss/(t + 1))
            delta *= 2
    print loss/(t + 1), avg_ctr / (t + 1)
    print "train:", len(tr_X), tr_loss/len(tr_X)
    if te_X:
        print "test:", len(te_X), te_loss/len(te_X)
    return tr_X, tr_y_true, te_X, te_y_true
dataset/ETHPy150Open Gzsiceberg/kaggle-avito/ensemble/stack.py/get_train_data/operator `in` -> `>`