0

I am defining an LDA classifier using

LDA <- discrim_regularized(frac_common_cov = 1) %>% set_engine("klaR")

And a QDA using

QDA <- discrim_regularized(frac_common_cov = 0) %>% set_engine("klaR")`

I want ti run them both against a df using fit_resamples() to train it and collect_metric() to compare their perfomance against each other.

I have wrote the following code

rec <-
  recipe(~., data = df) 

mm <- discrim_regularized(frac_common_cov = 1) %>%
  set_engine("klaR")

fit <- 
  workflow() %>% 
  add_model(mm) %>% 
  add_recipe(rec) %>% 
  fit_resamples(
    resamples = rs,
    control = control_resamples(save_pred = TRUE)
  ) 
collect_metrics(fit)

But I am getting All models failed.

What am I missing?

desertnaut
  • 57,590
  • 26
  • 140
  • 166
devcs
  • 11
  • 3
  • 2
    This looks very hard to answer without a reproducible example. See e.g. https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example – Axeman Jul 11 '23 at 18:57

0 Answers0