Cubist models

Function Works
tidypredict_fit(), tidypredict_sql(), parse_model()
tidypredict_to_column()
tidypredict_test()
tidypredict_interval(), tidypredict_sql_interval()
parsnip

tidypredict_ functions

library(Cubist)
data("BostonHousing", package =  "mlbench")

model <- Cubist::cubist(x = BostonHousing[, -14], y = BostonHousing$medv, committees = 3)

Parse model spec

Here is an example of the model spec:

pm <- parse_model(model)
str(pm, 2)
#> List of 2
#>  $ general:List of 5
#>   ..$ model  : chr "cubist"
#>   ..$ type   : chr "tree"
#>   ..$ version: num 2
#>   ..$ mode   : chr "ifelse"
#>   ..$ divisor: num 3
#>  $ trees  :List of 1
#>   ..$ :List of 14
#>  - attr(*, "class")= chr [1:3] "parsed_model" "pm_tree" "list"
str(pm$terms[1:2])
#>  NULL