Repository navigation
Parallelize the GapEncoder - #582
Conversation
GapEncoder
Vincent-Maladiere
left a comment
There was a problem hiding this comment.
Hey @LilianBoulard! We might want to chose n_jobs based on the number of columns and the number of available core.
The _partition_estimator function from sklearn could be insightful :)
https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/ensemble/_base.py#L216-L226
|
We might want to chose n_jobs based on the number of columns and the number of available core.
We never set parallelism on by default, because it can too easily lead to overcommit (eg with nested objects that have parallelism).
We have progressively evolved toward using n_jobs=None, which opens the door to joblib to make clever choices.
Our long-term view is that library users should rely on joblib.parallel_config to set parallel computing. But this is new and still to be experiment.
@tomMoral is the expert on these questions.
|
Ok, so what about the predict methods of RandomForest in sklearn? https://github.com/scikit-learn/scikit-learn/blob/main/sklearn/ensemble/_forest.py#L866 In case the user does set |
That's a good point. The code in RandomForest is there to create bunches of estimators. This is useful when there are many more iterations than CPUs. I do not think that it will be useful here. |
|
Aha not sure if I am an expert but here is my 2cts:
Also note that if possible, it is best to not change the |
GaelVaroquaux
left a comment
There was a problem hiding this comment.
LGTM. I made a tiny suggestion, but I will just merge it, and than merge this PR
* Parallelize the Gap column-wise * Add changelog entry * Update skrub/_gap_encoder.py --------- Co-authored-by: Gael Varoquaux <gael.varoquaux@normalesup.org>
* Quick bootstrap * misc * fix contributing link * stabilize current LP layout * add skrub banner * replace banner with the target * center feature blocks * replace banner with the pipeline * enable transparent bg for banner * add skrub banner * remove secondary sidebar * DOC: landing page is jinja, not rst (#589) * fall back to pandas if no datetime format is found (#587) * fall back to pandas if no datetime format is found * change changelog * Fix X shape in minhash_encoder docstrings (#584) * Parallelize the `GapEncoder` (#582) * Parallelize the Gap column-wise * Add changelog entry * Update skrub/_gap_encoder.py --------- Co-authored-by: Gael Varoquaux <gael.varoquaux@normalesup.org> * fix fetching params (#591) * remove index.rst * add empty but toctree index.rst --------- Co-authored-by: Gael Varoquaux <gael.varoquaux@normalesup.org> Co-authored-by: LeoGrin <45738728+LeoGrin@users.noreply.github.com> Co-authored-by: Lilian <lilian@boulard.fr> Co-authored-by: Jovan Stojanovic <62058944+jovan-stojanovic@users.noreply.github.com>
Implements parallelization of the
GapEncodercolumn-wise, as it is currently a simple for loop.This could speed up the process significantly for wide datasets (intuitively, to be benchmarked).