-
Notifications
You must be signed in to change notification settings - Fork 35
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
Harmonize batch distribution ++ #359
Merged
LHBO
merged 65 commits into
NorskRegnesentral:master
from
LHBO:Lars/bugfix_get_default_n_batches
Nov 20, 2023
Merged
Changes from 1 commit
Commits
Show all changes
65 commits
Select commit
Hold shift + click to select a range
9578520
Bugfix in `prepare_data()` related to vector of approaches. When usin…
LHBO 8da040d
# Lars have added `n_combinations` - 1 as a possibility, as the funct…
LHBO e9f6ae9
Samll typo.
LHBO 7412780
Fixed bug. All messages says "n_combinations is larger than or equal …
LHBO 22c8e17
Added script demonstrating the bug that shapr does not enter the exac…
LHBO a05b82f
Added (tentative) test that checks that shapr enters exact mode when …
LHBO d0f278d
Added script that demonstrates the bug before the bugfix, and added t…
LHBO 6fd2d91
Fixed lint warnings in `approach.R`.
LHBO 4f0bdb9
Added two parameters to the `internal$parameters` list which contains…
LHBO 2a940bf
Added test to check that `n_batches` must be larger than or equal to …
LHBO 303df5c
Updated `get_default_n_batches` to take into consideration the number…
LHBO c3c7a87
Changed where seed is set such that it applies for both regular and c…
LHBO 8e6cc9b
Typo
LHBO 246c2cf
Added test to check that setting the seed works for combined approaches.
LHBO e873f1d
typo in test function
LHBO 5a2c2eb
Added file to demonstrate the bugs (before the bugfix)
LHBO 42c5ed1
Added new test
LHBO bccf6ff
Updated tests by removing n_samples
LHBO 078c838
Added a bugfix to shapr not using the correct number of batches. Mayb…
LHBO 703b248
Updated the demonstration script
LHBO c903e6b
Added last test and fixed lintr
LHBO 801ff5f
Lint again.
LHBO 3d216ee
Merge remote-tracking branch 'origin/master' into Lars/bugfix_n_combi…
martinju 9de817f
styler
martinju d263f37
minor edits to tests
martinju 9fbd49f
Merge branch 'Lars/bugfix_n_combinations' into Lars/bugfix_combined_a…
martinju 14acadc
simplifies comment
martinju 0f617a4
comb files ok
martinju a0753e5
Merge master into branch
LHBO b7d4402
Updated bug in independence approach related to categorical features …
LHBO c28a264
Updated bug in independence approach related to categorical features …
martinju 0bf42bd
Merge branch 'Lars/bugfix_combined_approaches' of https://github.com/…
LHBO 7971eec
lint warning
LHBO c35e0bc
Lint
LHBO cb15629
lint
LHBO 6fb5350
Merge with the branch with the bugfix for the combined approaches. No…
LHBO d1a19b3
updated test files after accepting new values
martinju a3c238b
adjustments to comments and Lars' TODO-comments
martinju b0dd3bf
update snapshot file after weight adjustment
martinju 0988ace
cleaned up doc
martinju f790c22
rerun doc
martinju f9116db
style
martinju 67e5064
Merge branch 'master' into Lars/bugfix_combined_approaches
martinju 1fa2753
Merge branch 'Lars/bugfix_combined_approaches' into Lars/bugfix_get_d…
martinju 70f353f
Merged master into branch.
LHBO e0d925d
Changed to `n_batches = 10` in the combined approaches, as the previo…
LHBO 11cf088
Merge branch 'Lars/bugfix_get_default_n_batches' of github.com:LHBO/s…
martinju 0b146bc
accept OK test changes
martinju fa6a5b9
additonal Ok test files
martinju c2599fe
change batches in test files
martinju aacb474
accept new files
martinju 4dd1a86
handle issue with a breaking change update in the testthat package
martinju 30c202d
+ these
martinju a224648
removing last (unused) input of approach
martinju b6da078
updating tests
martinju c9ade53
+ update setup tests/snaps
martinju 4851217
correcting unique length
martinju cdc624d
update linting and vignette
martinju 8833b0f
update docs
martinju b865a65
fix example issue
martinju 53c57eb
temporary disable tests on older R systems
martinju a04f127
remove unecessary if-else test
martinju 79ddd35
data.table style on Lars's batch adjustment suggestion
martinju 4253ef5
del comment
martinju 2fd62b5
lint
martinju File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -693,15 +693,13 @@ get_default_n_batches <- function(approach, n_combinations) { | |
suggestion <- ceiling(n_combinations / 10) | ||
this_min <- 10 | ||
this_max <- 1000 | ||
min_checked <- max(c(this_min, suggestion)) | ||
ret <- min(c(this_max, min_checked)) | ||
} else { | ||
suggestion <- ceiling(n_combinations / 100) | ||
this_min <- 2 | ||
this_max <- 100 | ||
min_checked <- max(c(this_min, suggestion)) | ||
ret <- min(c(this_max, min_checked)) | ||
} | ||
min_checked <- max(c(this_min, suggestion)) | ||
ret <- min(c(this_max, min_checked, n_combinations - 1)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We subtract 1 as the |
||
message( | ||
paste0( | ||
"Setting parameter 'n_batches' to ", ret, " as a fair trade-off between memory consumption and ", | ||
|
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.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
We do not need the if-else anymore, so a simpler version of the code could be: