Skip to content

step_lencode_*() gives non-ideal errors when applied to constant vectors #229

@EmilHvitfeldt

Description

@EmilHvitfeldt
library(embed)
library(modeldata)

ames$const <- "red"

recipe(Street ~ const, data = ames) |>
  step_lencode_glm(const, outcome = vars(Street)) |>
  prep()
#> Error in `step_lencode_glm()`:
#> Caused by error in `purrr::map()`:
#> ℹ In index: 1.
#> ℹ With name: const.
#> Caused by error in `contrasts<-`:
#> ! contrasts can be applied only to factors with 2 or more levels

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurea feature request or enhancementtarget encodingTemporary label to group target encodings

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions