Skip to content

model comparison with k-fold cross validation #18

@bnicenboim

Description

@bnicenboim

Hi,
I just discovered this package, it looks very cool, now I'm trying to do k-fold cross validation with the log-score rule, what I would do with brms with:

k <- loo::kfold_split_random(K = 10, N = nrow(df))
k1 <- kfold(m1, chains = 1, folds = k)
k2 <- kfold(m2, chains = 1, folds = k)
loo_compare(k1, k2)

I guess I should start with

folds <- vfold_cv(houses_train, v = 10)

fit_folds1 <- my_workflow1 |>
  tune::fit_resamples(folds)

fit_folds2 <- my_workflow2 |>
  tune::fit_resamples(folds)

But I'm not sure how I should compare the models. (I can provide a complete reprex, if it's not clear)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions