Skip to content

DOC clarify that n_jobs argument uses threading in pairwise_distances and pairwise_kernels - #29693

Merged
lesteve merged 2 commits into
scikit-learn:mainfrom
stepan-srsen:pairwise_metric
Aug 23, 2024
Merged

lesteve merged 2 commits into
scikit-learn:mainfrom
stepan-srsen:pairwise_metric

Conversation

@stepan-srsen

Copy link
Copy Markdown
Contributor

Reference Issues/PRs

Fixes #29587

What does this implement/fix? Explain your changes.

Improves the documentation of pairwise_distances and pairwise_kernels so that it is clear that they use threading when the n_jobs argument is used. One could expect the functions to be truly parallel using multiprocessing otherwise, which is not the case and that has a serial performance impact for user-defined metric functions (see #29587).

@github-actions

github-actions Bot commented Aug 20, 2024 •

Copy link
Copy Markdown

✔️ Linting Passed

All linting checks passed. Your pull request is in excellent shape! ☀️

Generated for commit: dfcd469. Link to the linter CI: here

@thomasjpfan thomasjpfan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stepan-srsen Thank you for the PR!

I have a minor nit, but other wise LGTM.

Comment thread sklearn/metrics/pairwise.py Resolved
Comment thread sklearn/metrics/pairwise.py Resolved
Comment thread sklearn/metrics/pairwise.py Resolved
@lesteve lesteve changed the title clarification of the documentation for the n_jobs argument in pairwise_distances and pairwise_kernels DOC clarify that n_jobs argument uses threading in pairwise_distances and pairwise_kernels Aug 23, 2024
@lesteve

lesteve commented Aug 23, 2024

Copy link
Copy Markdown
Member

Merging this one thanks @stepan-srsen!

@lesteve
lesteve merged commit ede02b4 into scikit-learn:main Aug 23, 2024
@stepan-srsen
stepan-srsen deleted the pairwise_metric branch August 23, 2024 13:21
MarcBresson pushed a commit to MarcBresson/scikit-learn that referenced this pull request Sep 2, 2024
… and pairwise_kernels (scikit-learn#29693)

Co-authored-by: Stepan Srsen <[email protected]>
Co-authored-by: Thomas J. Fan <[email protected]>
glemaitre pushed a commit to glemaitre/scikit-learn that referenced this pull request Sep 9, 2024
… and pairwise_kernels (scikit-learn#29693)

Co-authored-by: Stepan Srsen <[email protected]>
Co-authored-by: Thomas J. Fan <[email protected]>
glemaitre pushed a commit that referenced this pull request Sep 11, 2024
… and pairwise_kernels (#29693)

Co-authored-by: Stepan Srsen <[email protected]>
Co-authored-by: Thomas J. Fan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Truly parallel execution of pairwise_kernels and pairwise_distances

3 participants