Description
I have used this page for help:
https://workflows.tidymodels.org/reference/predict-workflow.html
the workflow is a nlp task using lasso and textrecipes.
I fitted a workflow object using fit(wf, train_data)
Then I use the workflow object with predict(wf, newdata). no error. It works as expected.
If I saved the workflow object using write_rds(). Close the session, clean all objects, restart r.
I read the workflow object using read_rds(wf.rds), then apply predict to that object. It gives me error.
model_lasso_enhanced <- read_rds("disaster_tweets/models/model_lasso_enhanced.rds")
yo <- predict(model_lasso_enhanced, new_data = test, type = "prob")
Error in UseMethod("predict") :
no applicable method for 'predict' applied to an object of class "c('lognet', 'glmnet')"
class(model_lasso_enhanced)
[1] "workflow"