knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) source("_threads.R") 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() ```
We are not able to give an exact match of the original predictions due to a minor bug in Cubist.
Here is an example of the model spec:
pm <- parse_model(model) str(pm, 2)
str(pm$terms[1:2])
tidypredict_test() is not supportedAny 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.