Skip to content

Error in tidy.step_nnmf() #665

@EmilHvitfeldt

Description

@EmilHvitfeldt

Reprex:

library(tidymodels)
#> ── Attaching packages ────────────────────────────────────── tidymodels 0.1.1 ──
#> ✓ broom     0.7.2           ✓ recipes   0.1.15.9000
#> ✓ dials     0.0.9           ✓ rsample   0.0.9      
#> ✓ dplyr     1.0.5           ✓ tibble    3.1.0      
#> ✓ ggplot2   3.3.3           ✓ tidyr     1.1.3      
#> ✓ infer     0.5.3           ✓ tune      0.1.3.9000 
#> ✓ modeldata 0.1.0           ✓ workflows 0.2.1.9000 
#> ✓ parsnip   0.1.5.9001      ✓ yardstick 0.0.7      
#> ✓ purrr     0.3.4
#> ── Conflicts ───────────────────────────────────────── tidymodels_conflicts() ──
#> x purrr::discard() masks scales::discard()
#> x dplyr::filter()  masks stats::filter()
#> x dplyr::lag()     masks stats::lag()
#> x recipes::step()  masks stats::step()
rec <- recipe(~., data = mtcars) %>%
  step_nnmf(all_predictors()) %>%
  prep()

tidy(rec, 1)
#> Error: Input must be a vector, not NULL.

Created on 2021-03-11 by the reprex package (v0.3.0)

Haven't double-checked, but I think this

var_names <- colnames(x$res@other.data$H)

should be changed to

var_names <- colnames(x$res@other.data$w)

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