knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) library(tidypredict) library(Cubist) library(dplyr)
| Function |Works|
|---------------------------------------------------------------|-----|
|tidypredict_fit()
, tidypredict_sql()
, parse_model()
| ✔ |
|tidypredict_to_column()
| ✔ |
|tidypredict_test()
| ✔ |
|tidypredict_interval()
, tidypredict_sql_interval()
| ✗ |
|parsnip
| ✗ |
tidypredict_
functionslibrary(Cubist) data("BostonHousing", package = "mlbench") model <- Cubist::cubist(x = BostonHousing[, -14], y = BostonHousing$medv, committees = 3)
Create the R formula
r
tidypredict_fit(model)
SQL output example
r
tidypredict_sql(model, dbplyr::simulate_odbc())
Add the prediction to the original table ```r library(dplyr)
BostonHousing %>% tidypredict_to_column(model) %>% glimpse() ```
Confirm that tidypredict
results match to the model's predict()
results
r
tidypredict_test(model, BostonHousing)
Here is an example of the model spec:
pm <- parse_model(model) str(pm, 2)
str(pm$terms[1:2])
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.