vi_permute() throws warning: <anonymous>: ... may be used in an incorrect context
agilebean opened this issue · 2 comments
agilebean commented
The documentation for vi_permute()
says about option parallel
:
Logical indicating whether or not to run vi_permute() in parallel (using a backend provided by the foreach package). Default is FALSE. If TRUE, an appropriate backend must be provided by foreach.
However, the foreach package does not create a parallel backend. In the vignette and posts of the author, the parallel backend is created by the doParallel
package, e.g. by
parallel::makeForkCluster()
Using such a backend, the vi() function
times <- system.time(
model.vi <- model %>%
vi(
method = "permute",
target = ".outcome",
train = model$trainingData,
type = "ratio",
metric = "rmse",
keep = TRUE,
parallel = TRUE,
nsim = 2,
pred_wrapper = predict
)
throws the warning
Warning messages:
1: <anonymous>: ... may be used in an incorrect context: ‘.fun(piece, ...)’
What is the reason, and how can it be avoided?
Googling this message finds links to the ancient plyr
package...
bgreenwell commented
Will be fixed after removing the plyr dependency; see #126.
bgreenwell commented
Fixed in devel branch.