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
@@ -4,8 +4,8 @@ import xgboost as xgb
|
||||
### load data in do training
|
||||
dtrain = xgb.DMatrix('../data/agaricus.txt.train')
|
||||
dtest = xgb.DMatrix('../data/agaricus.txt.test')
|
||||
param = {'max_depth':2, 'eta':1, 'silent':1, 'objective':'binary:logistic' }
|
||||
watchlist = [(dtest,'eval'), (dtrain,'train')]
|
||||
param = {'max_depth':2, 'eta':1, 'silent':1, 'objective':'binary:logistic'}
|
||||
watchlist = [(dtest, 'eval'), (dtrain, 'train')]
|
||||
num_round = 3
|
||||
bst = xgb.train(param, dtrain, num_round, watchlist)
|
||||
|
||||
@@ -15,5 +15,5 @@ leafindex = bst.predict(dtest, ntree_limit=2, pred_leaf=True)
|
||||
print(leafindex.shape)
|
||||
print(leafindex)
|
||||
### predict all trees
|
||||
leafindex = bst.predict(dtest, pred_leaf = True)
|
||||
leafindex = bst.predict(dtest, pred_leaf=True)
|
||||
print(leafindex.shape)
|
||||
|
||||
Reference in New Issue
Block a user