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

"Assigned data orig_rows" error when tuning multinom_reg(engine = "nnet") #976

Open
simonpcouch opened this issue Jan 13, 2025 · 1 comment
Labels
bug an unexpected problem or unintended behavior

Comments

@simonpcouch
Copy link
Contributor

library(tidymodels)

model <- 
  multinom_reg(penalty = tune()) %>%
  set_engine("nnet") %>%
  set_mode("classification")

set.seed(1)
res <- tune_grid(
  workflow(class ~ ., model),
  vfold_cv(sim_classification(1000)),
  grid = 3
)
#> → A | error:   Assigned data `orig_rows` must be compatible with existing data.
#>                ✖ Existing data has 1 row.
#>                ✖ Assigned data has 100 rows.
#>                ℹ Row updates require a list value. Do you need `list()` or `as.list()`?
#>                Caused by error in `vectbl_recycle_rhs_rows()`:
#>                ! Can't recycle input of size 100 to size 1.
#> There were issues with some computations   A: x1
#> There were issues with some computations   A: x24
#> There were issues with some computations   A: x30
#> 
#> Warning: All models failed. Run `show_notes(.Last.tune.result)` for more
#> information.

# just to demonstrate this is engine-specific...
set.seed(1)
res <- tune_grid(
  workflow(class ~ ., set_engine(model, "glmnet")),
  vfold_cv(sim_classification(1000)),
  grid = 3
)

Created on 2025-01-13 with reprex v2.1.1

Filing here for now, but may ultimately live more cozily in parsnip. I see this with both CRAN and dev tune + CRAN and dev parsnip.

Possibly related/duplicate of #592. The wording of the error message has changed but the underlying cause might be the same.

@simonpcouch simonpcouch added the bug an unexpected problem or unintended behavior label Jan 13, 2025
@simonpcouch
Copy link
Contributor Author

FWIW, there are no NAs in this reprex's example data.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

1 participant