selbouhaddani / OmicsPLS

R package for High dimensional data analysis and integration with O2PLS!
https://doi.org/10.1186/s12859-018-2371-3
31 stars 8 forks source link

Add seed to make the analysis reproducible #18

Closed WENLITANG closed 2 years ago

WENLITANG commented 2 years ago

Firstly thanks for your hard work. When I used "crossval_o2m" or "crossval_o2m_adjR2" function, I often got different results. So I add seed ("crossval_o2m", "crossval_o2m_adjR2", "loocv_combi", "loocv") to make the analysis reproducible.

selbouhaddani commented 2 years ago

Thanks, I'll review it asap and incorporate it

GuangchuangYu commented 2 years ago

@selbouhaddani It is quite important to make the code reproducible. I am also looking forward to this feature.

selbouhaddani commented 2 years ago

@WENLITANG (cc @GuangchuangYu) Thanks so much for your contribution. I've included your work, and extended it a bit for backward compatibility. The default for cross validation is now seed = "off", which reproduces the previous random behavior. The user can explicitly specify a particular seed if desired. See commit 53bf180bc10a60cb0cf7c71ed8a508cbb99879d6.

Side note: I made the code a bit more computationally efficient (see commit cdb385dc609c9c6594ff9b85b56ac5e4674a3be9), so you may want to update to the latest version.