FIX accept uint8 X in hist-gbdt.predict #18410
Merged
Conversation
is_binned = getattr(self, '_in_fit', False) | ||
dtype = [X_BINNED_DTYPE] if is_binned else [X_DTYPE] |
Comment on lines
648
to
649
NicolasHug
Sep 16, 2020
Author
Member
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
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
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) |
thomasjpfan
Sep 17, 2020
Member
Does y
need to be casted here?
Suggested change
y = rng.randint(0, 2, size=10).astype(np.uint8)
y = rng.randint(0, 2, size=10)
Does y
need to be casted here?
Suggested change
y = rng.randint(0, 2, size=10).astype(np.uint8) | |
y = rng.randint(0, 2, size=10) |
NicolasHug
Sep 17, 2020
Author
Member
It's not what was causing the failure on master, but can't hurt to have it anyway?
It's not what was causing the failure on master, but can't hurt to have it anyway?
thomasjpfan
Sep 17, 2020
Member
Okay, lets keep it.
Okay, lets keep it.
LGTM |
wanna merge it @lorentzenchr ;) ? |
df61e9e
into
scikit-learn:master
19 checks passed
19 checks passed
scikit-learn.scikit-learn (Linux pylatest_pip_openblas_pandas)
Linux pylatest_pip_openblas_pandas succeeded
Details
scikit-learn.scikit-learn (Linux32 py36_ubuntu_atlas_32bit)
Linux32 py36_ubuntu_atlas_32bit succeeded
Details
scikit-learn.scikit-learn (Linux_Runs pylatest_conda_mkl)
Linux_Runs pylatest_conda_mkl succeeded
Details
scikit-learn.scikit-learn (Windows py36_pip_openblas_32bit)
Windows py36_pip_openblas_32bit succeeded
Details
scikit-learn.scikit-learn (macOS pylatest_conda_mkl_no_openmp)
macOS pylatest_conda_mkl_no_openmp succeeded
Details
amrcode
added a commit
to amrcode/scikit-learn
that referenced
this pull request
Oct 19, 2020
* fixed dtype issue * whatsnew * dont pass lists
jayzed82
added a commit
to jayzed82/scikit-learn
that referenced
this pull request
Oct 22, 2020
* fixed dtype issue * whatsnew * dont pass lists
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Fixes #18408