Skip to content

Conversation

@EmilHvitfeldt
Copy link
Member

library(tidymodels)
library(orbital)
library(DBI)
library(RSQLite)

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

lm_spec <- linear_reg()

wf_spec <- workflow(rec_spec, lm_spec)
wf_fit <- fit(wf_spec, data = mtcars)

orbital_obj <- orbital(wf_fit)

con <- dbConnect(SQLite(), path = ":memory:")

show_query(orbital_obj, con = con)
#> CASE WHEN ((`disp` IS NULL)) THEN 230.721875 WHEN NOT ((`disp` IS NULL)) THEN `disp` END AS disp
#> (`disp` - 230.721875) / 123.938693831382 AS disp
#> 20.090625 + (`disp` * -5.10814813429143) AS .pred

@JavOrraca
Copy link

That was fast. Amazing addition to orbital!

@EmilHvitfeldt EmilHvitfeldt merged commit 6ef4eb0 into main Oct 17, 2025
14 of 16 checks passed
@EmilHvitfeldt EmilHvitfeldt deleted the show_query branch October 17, 2025 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants