You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to convert the attached XGboost model, which was trained using XGboost v1.3-1 + binary:logistic + early_stopping. The conversion results in an exception due to the fact that the source code assumes it is a multi:* objective function rather than a binary:logistic.
if trees > ntrees > 0:
state = booster.__getstate__()
bstate = bytes(state['handle'])
reg = re.compile(b'(multi:[a-z]{1,15})')
objs = list(set(reg.findall(bstate)))
if len(objs) != 1:
raise RuntimeError(
"Unable to guess objective in {}.".format(objs))
kwargs['num_class'] = trees // ntrees
kwargs["objective"] = objs[0].decode('ascii')
else:
kwargs['num_class'] = 1
kwargs["objective"] = "binary:logistic"
I am trying to convert the attached XGboost model, which was trained using XGboost v1.3-1 + binary:logistic + early_stopping. The conversion results in an exception due to the fact that the source code assumes it is a multi:* objective function rather than a binary:logistic.
Source code as follows:
model.tar.gz
The text was updated successfully, but these errors were encountered: