Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cv_varsel.refmodel(): cv_search == "kfold" #95

Closed
fweber144 opened this issue Mar 19, 2021 · 1 comment
Closed

cv_varsel.refmodel(): cv_search == "kfold" #95

fweber144 opened this issue Mar 19, 2021 · 1 comment

Comments

@fweber144
Copy link
Collaborator

In cv_varsel.refmodel(), line

if (validate_search || cv_search == "kfold") {
uses cv_search == "kfold". But is cv_search == "kfold" possible? Should it read cv_method == "kfold" instead?

AlejandroCatalina added a commit that referenced this issue Mar 22, 2021
@fweber144
Copy link
Collaborator Author

fweber144 commented Mar 24, 2021

Just for the sake of completeness (and for testing the fix): This issue was indeed able to raise an error in earlier versions on develop:

library(projpred)
library(rstanarm)
options(mc.cores = parallel::detectCores(logical = FALSE))
data('df_gaussian', package = 'projpred')
mydat <- cbind("y" = df_gaussian$y, as.data.frame(df_gaussian$x))
myfit <- stan_glm(y ~ V1 + V2 + V3 + V4 + V5,
                  family = gaussian(),
                  data = mydat,
                  prior = hs(df = 1, global_scale=0.01), seed = 1140350788)

cvs <- cv_varsel(
  myfit,
  method = "forward",
  cv_method = "kfold",
  validate_search = FALSE,
  K = 5
)

But this is fixed now by commit 021c7ef.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant