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

How it works

Here is a simple randomForest() model using the iris dataset:

library(dplyr)
library(tidypredict)
library(randomForest)

model <- randomForest(Species ~ .,data = iris ,ntree = 100, proximity = TRUE)

Under the hood

The parser is based on the output from the randomForest::getTree() function. It will return as many decision paths as there are non-NA rows in the prediction field.

The output from parse_model() is transformed into a dplyr, a.k.a Tidy Eval, formula. The entire decision tree becomes one dplyr::case_when() statement

From there, the Tidy Eval formula can be used anywhere where it can be operated. tidypredict provides three paths:

parsnip

tidypredict also supports randomForest model objects fitted via the parsnip package.