(tidymodels) Broom + Parsnip + Multinomial = Error: object of type 'closure' is not subsettable

I'm trying to run a multinomial (nnet) using tidymodel, but it shows me the next result:

Error: object of type 'closure' is not subsettable

data(iris)
ml<-multinom_reg() %>% 
  set_engine("nnet") %>% 
  set_mode("classification") %>% 
  translate()
ml_fit <- ml %>% 
  fit(Species ~ Sepal.Width, data=iris) 
broom::tidy(ml_fit, exponentiate = F)

But when I run ... works perfectly

formula <- Species ~ Sepal.Width
model <- nnet::multinom(formula, data = iris)
broom::tidy(model, exponentiate = F)

Any idea of whether or not I'm writing properly the tidy model or is something else?

I have run into the same problem before, I guess there isn't an appropriate tidy method for models created with the nnet engine? When I switched to glmnet, tidy(model) works just fine.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.