Skip to content

Progressr and future_lapply #173

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

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft

Progressr and future_lapply #173

wants to merge 5 commits into from

Conversation

mayer79
Copy link
Collaborator

@mayer79 mayer79 commented Jul 23, 2025

Will keep it open, but not merge yet

This PR brings to changes that were very high up in the candidates for release 1.0.0:

  • Use modern parallel computing: future.apply::future_lapply(): To use {kernelshap()} in parallel mode, the user now can simply run plan(...). No other changes are necessary. Compared to the old approach (foreach), packages like {ranger} etc seem to be correctly moved into the corresponding environments. This did not work before because the need for these packages are masked by stats::predict().
  • The old progress bar has been replaced by {progressr}. To activate, the user has to set, e.g., `progressr::handlers(global = TRUE) or some more fancy progress bar. What is really neat: this even works in parallel mode. I have added the package as suggested package to not increase the dependency footprint.

@pbiecek
@dswatson

Let me know if you see some other important stuff for version 1.

@mayer79 mayer79 self-assigned this Jul 23, 2025
@mayer79 mayer79 added the enhancement New feature or request label Jul 23, 2025
@codecov-commenter
Copy link

codecov-commenter commented Jul 23, 2025

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 97.40260% with 2 lines in your changes missing coverage. Please review.

Project coverage is 96.40%. Comparing base (61e82e4) to head (faef166).

Files with missing lines Patch % Lines
R/utils_kernelshap.R 87.50% 1 Missing ⚠️
R/utils_permshap.R 83.33% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #173      +/-   ##
==========================================
- Coverage   96.71%   96.40%   -0.31%     
==========================================
  Files           7        7              
  Lines         669      668       -1     
==========================================
- Hits          647      644       -3     
- Misses         22       24       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mayer79 mayer79 marked this pull request as draft July 23, 2025 17:44
@mayer79 mayer79 marked this pull request as ready for review July 23, 2025 17:55
Copy link
Member

@pbiecek pbiecek left a comment

Choose a reason for hiding this comment

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

Wow, both extensions are a great

A minor drawback is the additional dependencies, but these packages are fairly safe and should not cause any problems in the future.

looking forward version 1.0 on CRAN 🎉🎉🎉

@mayer79
Copy link
Collaborator Author

mayer79 commented Jul 24, 2025

I am not yet 100% convinced of future_lapply/progressr. So I am tending to release 0.9 without this PR, then take sometime to gain more experience with it, and then eventually go for 1.0.0.

@mayer79 mayer79 marked this pull request as draft July 25, 2025 12:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants