[Breaking] Fix custom metric for multi output. (#5954)

* Set output margin to true for custom metric.  This fixes only R and Python.
This commit is contained in:
Jiaming Yuan
2020-07-29 19:25:27 +08:00
committed by GitHub
parent 75b8c22b0b
commit 18349a7ccf
7 changed files with 41 additions and 13 deletions

View File

@@ -1228,7 +1228,8 @@ class Booster(object):
res = msg.value.decode()
if feval is not None:
for dmat, evname in evals:
feval_ret = feval(self.predict(dmat, training=False), dmat)
feval_ret = feval(self.predict(dmat, training=False,
output_margin=True), dmat)
if isinstance(feval_ret, list):
for name, val in feval_ret:
res += '\t%s-%s:%f' % (evname, name, val)