Skip to content

Can't augment() a workflows where recipe blueprint has sparse composition #148

Closed
@EmilHvitfeldt

Description

@EmilHvitfeldt
library(tidymodels)
library(hardhat)

sparse_bp <- default_recipe_blueprint(composition = "dgCMatrix")

rec_spec <-
  recipe(mpg ~ ., data = mtcars)

xgb_spec <-
  boost_tree(mode = "regression") %>%
  set_engine("xgboost")

wf_sparse <- 
  workflow() %>%
  add_recipe(rec_spec, blueprint = sparse_bp) %>%
  add_model(xgb_spec)

fit_sparse <- fit(wf_sparse, mtcars)

augment(fit_sparse, new_data = mtcars)
#> Error in `dplyr::bind_cols()`:
#> ! Input must be a vector, not a <dgCMatrix> object.

Created on 2022-03-25 by the reprex package (v2.0.1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugan unexpected problem or unintended behavior

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions