Skip to content

Predict in bigquery #59

@joscani

Description

@joscani

Hi . I'm trying to predict in bigquery.

With your example of how predit mtcars I get this

mtcars_db <-  sc |> tbl(I("churn2.mtcars"))


rec_spec <- recipe(mpg ~ ., data = mtcars) |>
  step_normalize(all_numeric_predictors())

lm_spec <- linear_reg()

wf_spec <- workflow(rec_spec, lm_spec)

wf_fit <- fit(wf_spec, mtcars)

predict(wf_fit, mtcars)
predict(wf_fit, mtcars_db)


orbital_obj  <- orbital(wf_fit)

predict(orbital_obj, mtcars_db)
Error in `bq_project_query()`:
! Job central-splice-420820.job_M8_0p0iJImfODZZML5tquYZXThxO.us-central1 failed
✖ Invalid field name ".pred". Fields must contain the allowed characters, and be at most 300
  characters long. For allowed characters, please refer to
  https://cloud.google.com/bigquery/docs/schemas#column_names [invalid]
Run `rlang::last_trace()` to see where the error occurred.```

How can I change pred column name from .pred to a proper name? 
Thanks

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