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
)

We are not able to give an exact match of the original predictions due to a minor bug in Cubist.

Parse model spec

Here is an example of the model spec:

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