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().
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 stableabind::adrop()
.