-
Notifications
You must be signed in to change notification settings - Fork 120
Open
Labels
featurea feature request or enhancementa feature request or enhancementtidy-dev-day 🤓Tidyverse Developer Day rstd.io/tidy-dev-dayTidyverse Developer Day rstd.io/tidy-dev-day
Description
This should happen in prep.step_isomap()
. As we can check x$neighbors
against nrow(training)
but should properly happen inside the if (x$num_terms > 0 && length(col_names) > 0L) {
chunk to avoid this error from triggering if nothing is selected.
library(recipes)
recipe(mpg ~ ., data = mtcars) |>
step_isomap(all_numeric_predictors(), neighbors = 31) |>
prep()
#> ── Recipe ──────────────────────────────────────────────────────────────────────
#>
#> ── Inputs
#> Number of variables by role
#> outcome: 1
#> predictor: 10
#>
#> ── Training information
#> Training data contained 32 data points and no incomplete rows.
#>
#> ── Operations
#> • Isomap approximation with: cyl, disp, hp, drat, wt, qsec, ... | Trained
recipe(mpg ~ ., data = mtcars) |>
step_isomap(all_numeric_predictors(), neighbors = 32) |>
prep()
#> Error in `step_isomap()`:
#> Caused by error in `prep()`:
#> ! Failed to compute:
#> Caused by error in `RANN::nn2()`:
#> ! Cannot find more nearest neighbours than there are points
Metadata
Metadata
Assignees
Labels
featurea feature request or enhancementa feature request or enhancementtidy-dev-day 🤓Tidyverse Developer Day rstd.io/tidy-dev-dayTidyverse Developer Day rstd.io/tidy-dev-day