tidymodels / tidymodels.org-legacy

Legacy Source of tidymodels.org
https://github.com/tidymodels/tidymodels_dot_org
Creative Commons Attribution Share Alike 4.0 International
99 stars 31 forks source link

Use adrop #277

Closed EmilHvitfeldt closed 1 year ago

EmilHvitfeldt commented 1 year ago

This was originally brought up in https://github.com/tidymodels/recipes/issues/1081.

The issue happened when the number of outcomes was reduced to 1 instead of 3 (as in the document), then drop(pls::R2(mod, estimate = "train", intercept = FALSE)$val) would produce a numeric vector instead of a numeric matrix because the dimensions were [1, 1, 102]. This PR fixes that by using the more stable abind::adrop().