Skip to content

Comments

Reproducibility Fix#87

Merged
vladpetyuk merged 3 commits intomasterfrom
seed_fix
Oct 16, 2025
Merged

Reproducibility Fix#87
vladpetyuk merged 3 commits intomasterfrom
seed_fix

Conversation

@Ben-Drucker
Copy link

Purpose: Makes it possible to get exactly the same output, if running the same exact command (on a given computer). See comments in code for explanation of the changes.

Caveat: Exact reproduciblity will likely not hold across computing machines and/or operating systems. The reason is explained here.

Copy link
Author

@Ben-Drucker Ben-Drucker left a comment

Choose a reason for hiding this comment

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

Explanations of changes

})))
set.seed(seed)
seed_seq <- sample(-.Machine$integer.max:.Machine$integer.max, size = K)
seed_seq <- sample(1:.Machine$integer.max, size = K)
Copy link
Author

Choose a reason for hiding this comment

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

Boruta's underlying random forest engine, ranger::ranger uses C++ code that only accepts uints as random seeds, i.e., positive integers. Using a negative caused reproducibility issues.

if(sel.feat){
features.sel <- FUN(x=dSet[!i,features],
y=dSet[!i,response], seed = seed)
y=dSet[!i,response], seed = seed, ...)
Copy link
Author

Choose a reason for hiding this comment

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

This is not directly related to reproducibility, but adds the ability to pass additional arguments to Boruta::Boruta

Comment on lines -186 to -188
varSelRF = select_features_varSelRF,
varSelRF = function(x, y, ...) select_features_varSelRF(x,y),
Boruta = function(x,y, ...) select_features_Boruta(x,y,...),
top = select_features_top)
Copy link
Author

Choose a reason for hiding this comment

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

Remove ... from being passed to non-Boruta feature selection methods.

@vladpetyuk vladpetyuk merged commit 43e4612 into master Oct 16, 2025
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants