def cv_method():
    tr_X, tr_y_true, te_X, te_y_true = get_train_data()
    if "nn" in args.model:
        tr_X = np.array(tr_X).astype(np.float32)
        tr_y_true = np.array(tr_y_true).astype(np.int32)
        model = get_nn_model(tr_X.shape)
        model.fit(tr_X, tr_y_true)
        write_dump("%s_model.dump"%args.model, model)
        if te_X:
            te_X = np.array(te_X).astype(np.float32)
            preds = model.predict_proba(te_X)[:, 1]
            np.savetxt("nn_preds.txt", preds)
            print log_loss(te_y_true, preds)
    elif "xgb" in args.model:
        dtrain = xgb.DMatrix(tr_X, label=tr_y_true)
        if args.predict == "cv":
            if te_X:
                dtest = xgb.DMatrix(te_X, label=te_y_true)
            param = {
                    'max_depth':3,
                    'eta':0.1,
                    'silent':1,
                    'objective':'binary:logistic',
                    "eval_metric": "logloss",
                    "nthread": 9,
                    }
            if te_X:
                watchlist  = [(dtrain,'train'), (dtest, "eval")]
            else:
                watchlist  = [(dtrain,'train'),]
            num_round = 132
            bst = xgb.train(param, dtrain, num_round, watchlist)
            bst.save_model("%s_model.dump"/args.model)
            if te_X:
                preds = bst.predict(dtest)
                np.savetxt("xgb_preds.txt", preds)
dataset/ETHPy150Open Gzsiceberg/kaggle-avito/ensemble/stack.py/cv_method/operator `%` -> `/`