Esempio n. 1
0
         'subsample':1,
         'silent':1, 
         'nthread':27,
#         'scale_pos_weight':y_build.mean(),
#         'eval_metric':'auc',
         'eval_metric':'logloss',
         'objective':'binary:logistic',
         'tree_method':'hist'}

print("""#==== print param ======""")
print('seed:', seed)

#==============================================================================
# prepare
#==============================================================================
train = pd.concat([utils.load_pred_None('trainT-0', W, True).sample(frac=.2),
                   utils.load_pred_None('trainT-1', W, True).sample(frac=.2),
                   utils.load_pred_None('trainT-2', W, True).sample(frac=.2)
                   ], ignore_index=True, join='inner')

sub_train = train[['order_id', 'y']]
y_train = train['y']
X_train = train.drop('y', axis=1)
del train; gc.collect()

# drop id
col = [c for c in X_train.columns if '_id' in c] + ['is_train']
col.remove('user_id')
print('drop1',col)
X_train.drop(col, axis=1, inplace=True) # keep user_id
Esempio n. 2
0
    'silent': 1,
    'nthread': 28,
    'eval_metric': 'logloss',
    'objective': 'binary:logistic',
    'tree_method': 'hist'
}

print("""#==== print param ======""")
print('DATE:', DATE)
print('seed:', seed)

#==============================================================================
# prepare
#==============================================================================
train = pd.concat([
    utils.load_pred_None('trainT-0', 3),
    utils.load_pred_None('trainT-1', 3),
    utils.load_pred_None('trainT-2', 3)
],
                  ignore_index=True)

sub_train = train[['order_id', 'y']]
y_train = train['y']
X_train = train.drop('y', axis=1)
del train
gc.collect()

# drop id
col = [c for c in X_train.columns if '_id' in c] + ['is_train']
col.remove('user_id')
print('drop1', col)
         'subsample':0.75,
         'silent':1, 
         'nthread':28,
         'eval_metric':'logloss',
         'objective':'binary:logistic',
         'tree_method':'hist'
         }

print("""#==== print param ======""")
print('DATE:', DATE)
print('seed:', seed)

#==============================================================================
# prepare
#==============================================================================
train = pd.concat([utils.load_pred_None('trainT-0', 3),
                   utils.load_pred_None('trainT-1', 3),
                   utils.load_pred_None('trainT-2', 3)
                   ], ignore_index=True)

sub_train = train[['order_id', 'y']]
y_train = train['y']
X_train = train.drop('y', axis=1)
del train; gc.collect()

# drop id
col = [c for c in X_train.columns if '_id' in c] + ['is_train']
col.remove('user_id')
print('drop1',col)
X_train.drop(col, axis=1, inplace=True) # keep user_id