Open smingerson opened 3 years ago
I looked at this a little bit today; it seems like a weird one to me.
prune_method
like "backward"
, "none"
, etc, the prod_degree
quosure is getting evaluated just fine by eval_tidy()
within eval_mod()
and sent on to earth::earth()
. "cv"
, the quosure is getting checked by earth:::check.integer.scalar()
which finds it is not numeric.Any updates for this bug?
Either I don't tune "cv" in prune_method
mars_model <- list(
mars = mars(
mode = "classification",
engine = "earth",
num_terms = tune(),
prod_degree = tune(),
prune_method = tune()
)
)
→ A | error: the nfold argument must be specified when pmethod="cv"
or I try to tune "cv" and it breaks the other methods
mars_model <- list(
mars = mars(
mode = "classification",
num_terms = tune(),
prod_degree = tune(),
prune_method = tune()
) %>%
set_engine("earth", nfold = 5)
)
→ A | error: 'degree' must be numeric, or TRUE or FALSE (whereas its current class is "quosure,formula")
Problem
The
prod_degree
argument cannot be specified ifprune_method="cv"
. Usingtranslate()
, the equivalentearth::earth()
call runs, so I think this is a bug in parsnip. The parsnip model does fit if I use other pruning methods, excepting "exhaustive". I did not include that here because the correspondingearth::earth()
call failed, and is beyond my ability to diagnose.Using dev parsnip and 5.3.0 earth
Created on 2021-02-16 by the reprex package (v1.0.0)