Minor edits to coding style (#2835)
* Some minor changes to the code style Some minor changes to the code style in file basic_walkthrough.py * coding style changes * coding style changes arrcording PEP8 * Update basic_walkthrough.py
This commit is contained in:
committed by
Yuan (Terry) Tang
parent
d9d5293cdb
commit
91af8f7106
@@ -15,11 +15,11 @@ dtest = xgb.DMatrix(data[4741:6773, 0:34], data[4741:6773, 34])
|
||||
param = {'silent':1, 'objective':'reg:gamma', 'booster':'gbtree', 'base_score':3}
|
||||
|
||||
# the rest of settings are the same
|
||||
watchlist = [(dtest,'eval'), (dtrain,'train')]
|
||||
watchlist = [(dtest, 'eval'), (dtrain, 'train')]
|
||||
num_round = 30
|
||||
|
||||
# training and evaluation
|
||||
bst = xgb.train(param, dtrain, num_round, watchlist)
|
||||
preds = bst.predict(dtest)
|
||||
labels = dtest.get_label()
|
||||
print ('test deviance=%f' % (2 * np.sum((labels - preds) / preds - np.log(labels) + np.log(preds))))
|
||||
print('test deviance=%f' % (2 * np.sum((labels - preds) / preds - np.log(labels) + np.log(preds))))
|
||||
|
||||
Reference in New Issue
Block a user