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:
3
demo/guide-python/gamma_regression.py
Executable file → Normal file
3
demo/guide-python/gamma_regression.py
Executable file → Normal file
@@ -1,4 +1,3 @@
|
||||
#!/usr/bin/python
|
||||
import xgboost as xgb
|
||||
import numpy as np
|
||||
|
||||
@@ -12,7 +11,7 @@ dtest = xgb.DMatrix(data[4741:6773, 0:34], data[4741:6773, 34])
|
||||
|
||||
# for gamma regression, we need to set the objective to 'reg:gamma', it also suggests
|
||||
# to set the base_score to a value between 1 to 5 if the number of iteration is small
|
||||
param = {'silent':1, 'objective':'reg:gamma', 'booster':'gbtree', 'base_score':3}
|
||||
param = {'objective':'reg:gamma', 'booster':'gbtree', 'base_score':3}
|
||||
|
||||
# the rest of settings are the same
|
||||
watchlist = [(dtest, 'eval'), (dtrain, 'train')]
|
||||
|
||||
Reference in New Issue
Block a user