bugfix type-check xgb_model param
This commit is contained in:
parent
4fe2f2fb09
commit
b894f7c9d6
@ -63,7 +63,7 @@ def train(params, dtrain, num_boost_round=10, evals=(), obj=None, feval=None,
|
||||
evals = list(evals)
|
||||
ntrees = 0
|
||||
if xgb_model is not None:
|
||||
if xgb_model is not isinstance(xgb_model, STRING_TYPES):
|
||||
if not isinstance(xgb_model, STRING_TYPES):
|
||||
xgb_model = xgb_model.save_raw()
|
||||
bst = Booster(params, [dtrain] + [d[0] for d in evals], model_file=xgb_model)
|
||||
ntrees = len(bst.get_dump())
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user