New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX accept uint8 X in hist-gbdt.predict #18410
Conversation
is_binned = getattr(self, '_in_fit', False) | ||
dtype = [X_BINNED_DTYPE] if is_binned else [X_DTYPE] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in master, X would still be of dtype X_BINNED_DTYPE
(pass-through) but is_binned
would be False so we'd call _predict_from_numeric_data
which can only accept X_DTYPE
, hence the failure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
rng = np.random.RandomState(0) | ||
|
||
X = rng.randint(0, 100, size=(10, 2)).astype(np.uint8) | ||
y = rng.randint(0, 2, size=10).astype(np.uint8) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does y
need to be casted here?
y = rng.randint(0, 2, size=10).astype(np.uint8) | |
y = rng.randint(0, 2, size=10) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not what was causing the failure on master, but can't hurt to have it anyway?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay, lets keep it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
wanna merge it @lorentzenchr ;) ? |
* fixed dtype issue * whatsnew * dont pass lists
* fixed dtype issue * whatsnew * dont pass lists
Fixes #18408