Closed juliasilge closed 1 year ago
We can still bundle the prepped recipe, which seems weird:
Sys.setenv(RETICULATE_PYTHON="/Users/juliasilge/miniforge3/envs/keras-connect/bin/python")
library(recipes)
#> Loading required package: dplyr
#>
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#>
#> filter, lag
#> The following objects are masked from 'package:base':
#>
#> intersect, setdiff, setequal, union
#>
#> Attaching package: 'recipes'
#> The following object is masked from 'package:stats':
#>
#> step
library(embed)
rec <-
recipe(mpg ~ ., data = mtcars) |>
step_umap(all_predictors(), outcome = vars(mpg), num_comp = 2) |>
prep()
bundle::bundle(rec)
#> bundled recipe object.
Created on 2023-08-21 with reprex v2.0.2
A couple more pieces of the puzzle from spending some time with this this afternoon:
That uwot:::all_nn_indices_are_loaded()
helper is just looking for a nn_index
slot inside of step$object
. In hardhat:::mold_recipe_default_process()
, the prepped recipe is dropped inside of the blueprint
rather than the recipe action. So:
mod$pre$actions$recipe$recipe$steps[[1]]$object
#> NULL
mod$pre$mold$blueprint$recipe$steps[[1]]$object
#> redacted for brevity...
#>
#> $n_neighbors
#> [1] 15
#>
#> $nn_index
#> $nn_index$ann
#> C++ object <0x11e50d9e0> of class 'AnnoyEuclidean' <0x12fca5f60>
#>
#> $nn_index$type
#> [1] "annoyv1"
#>
#> $nn_index$metric
#> [1] "euclidean"
#>
#> ...redacted for brevity
I think the former is supposed to contain the unprepped recipe while the latter is supposed to contain the prepped one? If so, I think removing
and
would resolve the issue, as we shouldn't need to worry about serialization of unprepped steps. A PR suggesting that change is incoming. :)
we shouldn't need to worry about serialization of unprepped steps
YES, makes sense 👍
While working on #53 I found a new problem in bundling
step_embed()
:Created on 2023-08-21 with reprex v2.0.2