Update Python demos with tests. (#5651)
* Remove GPU memory usage demo. * Add tests for demos. * Remove `silent`. * Remove shebang as it's not portable.
This commit is contained in:
@@ -8,7 +8,7 @@ label = train[:,32]
|
||||
data = train[:,1:31]
|
||||
weight = train[:,31]
|
||||
dtrain = xgb.DMatrix( data, label=label, missing = -999.0, weight=weight )
|
||||
param = {'max_depth':6, 'eta':0.1, 'silent':1, 'objective':'binary:logitraw', 'nthread':4}
|
||||
param = {'max_depth':6, 'eta':0.1, 'objective':'binary:logitraw', 'nthread':4}
|
||||
num_round = 120
|
||||
|
||||
print ('running cross validation, with preprocessing function')
|
||||
|
||||
@@ -37,7 +37,6 @@ param['scale_pos_weight'] = sum_wneg/sum_wpos
|
||||
param['eta'] = 0.1
|
||||
param['max_depth'] = 6
|
||||
param['eval_metric'] = 'auc'
|
||||
param['silent'] = 1
|
||||
param['nthread'] = 16
|
||||
|
||||
# you can directly throw param in, though we want to watch multiple metrics here
|
||||
|
||||
@@ -45,6 +45,3 @@ for k, v in res:
|
||||
fo.close()
|
||||
|
||||
print ('finished writing into prediction file')
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@ param['scale_pos_weight'] = sum_wneg/sum_wpos
|
||||
param['bst:eta'] = 0.1
|
||||
param['bst:max_depth'] = 6
|
||||
param['eval_metric'] = 'auc'
|
||||
param['silent'] = 1
|
||||
param['nthread'] = 4
|
||||
|
||||
plst = param.items()+[('eval_metric', 'ams@0.15')]
|
||||
|
||||
Reference in New Issue
Block a user