You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I did a speed comparison of the Yeo-Johnson transformation functions from {recipes} and {bestNormalize} packages. It seems there is some overhead in {recipes} package (especially for large datasets) and I wonder if this can be optimized in some way.
I don't know that we will want to consider importing an external package for this, but maybe we can look into anything our implementation is doing that may be unnecessarily slow, given our priorities.
Thank you all for looking into this and working to optimize these transformation functions. Emil, I will borrow a few of your tips for bestNormalize if you don't mind.
Thanks! I rerun the code from the first post and now {recipes} is 30 seconds faster compared to the earlier version. Below is a comparison with the new (1.8.2) {bestNormalize} version - performance is very similar.
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex https://reprex.tidyverse.org) and link to this issue.
Activity
juliasilge commentedon Sep 9, 2021
Looks like there may be some differences between how recipes currently implements the Yeo-Johnson transformation and how bestNormalize does:
Created on 2021-09-09 by the reprex package (v2.0.1)
I don't know that we will want to consider importing an external package for this, but maybe we can look into anything our implementation is doing that may be unnecessarily slow, given our priorities.
kadyb commentedon Sep 9, 2021
Kindly ping @petersonR, could you give some advice on optimization?
kadyb commentedon Sep 10, 2021
Out of curiosity I also checked the BoxCox transformation and in this case
{recipes}is faster.EmilHvitfeldt commentedon Sep 10, 2021
I couldn't resist, so I tried to optimize a little bit and I got a 60% increase over
recipes::estimate_yjwith a lot less memory allocationCreated on 2021-09-10 by the reprex package (v2.0.1)
Code
petersonR commentedon Sep 13, 2021
Thank you all for looking into this and working to optimize these transformation functions. Emil, I will borrow a few of your tips for
bestNormalizeif you don't mind.EmilHvitfeldt commentedon Sep 13, 2021
@petersonR Sure thing!
EmilHvitfeldt commentedon Sep 17, 2021
@juliasilge do you want me to package my above improvements into a PR?
juliasilge commentedon Sep 17, 2021
Yes, that sounds great! Can you include a few more examples with the PR showing how the results compare, beyond the tests we have?
kadyb commentedon Sep 20, 2021
Thanks! I rerun the code from the first post and now
{recipes}is 30 seconds faster compared to the earlier version. Below is a comparison with the new (1.8.2){bestNormalize}version - performance is very similar.github-actions commentedon Oct 5, 2021
This issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with a reprex https://reprex.tidyverse.org) and link to this issue.