-
-
Notifications
You must be signed in to change notification settings - Fork 25.8k
FIX Support read-only sparse datasets for Tree
-based estimators
#25341
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 Support read-only sparse datasets for Tree
-based estimators
#25341
Conversation
const
-qualify BaseSparseSplitter
attributes of CSR data const
-qualify BaseSparseSplitter
attributes of CSR or CSC data
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.
👍
const
-qualify BaseSparseSplitter
attributes of CSR or CSC data Tree
-based estimators
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.
Thank you for the PR! There is a merge conflict with main
to be resolved.
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
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.
Otherwise LGTM
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
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
…ikit-learn#25341) Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
…ikit-learn#25341) Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
…ikit-learn#25341) Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
…5341) Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com> Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
Reference Issues/PRs
Fixes #25333.
Fixes #25247.
What does this implement/fix? Explain your changes.
In some workflows using
DecisionTree*
(this includeRandomForest*
andExtraTrees*
):joblib
might memmap arrays making their buffer read-only.Those cases are correctly supported when using dense datasets thanks to
const
-qualification of memoryview in Cython. Yet those cases aren't currently supported when using sparse datasets (for instance whenX
is provided as a CSC or as a CSR matrix).const
-qualifying CSC or CSR buffers (i.e.data
,indices
andindptr
) inBaseSparseSplitter
allows supporting those cases when using sparse datasets.