keep builtin evaluations while using customized evaluation function (#1624)
* keep builtin evaluations while using customized evaluation function * fix concat bytes to str
This commit is contained in:
parent
8b9d9669bb
commit
55bfc29942
@ -864,7 +864,6 @@ class Booster(object):
|
||||
result: str
|
||||
Evaluation result string.
|
||||
"""
|
||||
if feval is None:
|
||||
for d in evals:
|
||||
if not isinstance(d[0], DMatrix):
|
||||
raise TypeError('expected DMatrix, got {}'.format(type(d[0]).__name__))
|
||||
@ -878,9 +877,8 @@ class Booster(object):
|
||||
_check_call(_LIB.XGBoosterEvalOneIter(self.handle, iteration,
|
||||
dmats, evnames, len(evals),
|
||||
ctypes.byref(msg)))
|
||||
return msg.value
|
||||
else:
|
||||
res = '[%d]' % iteration
|
||||
res = msg.value.decode()
|
||||
if feval is not None:
|
||||
for dmat, evname in evals:
|
||||
feval_ret = feval(self.predict(dmat), dmat)
|
||||
if isinstance(feval_ret, list):
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user