Trying parsnip::predict() gives me...
'predict' is not an exported object from 'namespace:parsnip'
Is this normal?
Trying parsnip::predict() gives me...
'predict' is not an exported object from 'namespace:parsnip'
Is this normal?
Yes, its normal. I see no problem here.
Unless there are other packages involved.
stats::predict() is forced to use pkg. forecast (3.)
[1] "package:stats"
Error in ets(object, lambda = lambda, biasadj = biasadj, allow.multiplicative.trend = allow.multiplicative.trend, :
y should be a univariate time series
▆
<fn>
(<tibble[,206]>
, <tibble[,83]>
, <tibble[,8]>
, shortVersion = 1)Sadly, we have zero context for what you are doing...
did you look at parsnip::predict
because you had used parsnip to fit some kind of model ? and if so , what type ? or if you didn't use parsnip, what did you use ?
some code relating to how you fit the model object you wish to predict on would be good ... a reprex is the gold standard.
I use this example.... with my own data.
Yes I try to predict a fitted parsnip-model.
Update: Turns out, wrong input-format for stats::predict() leads to this missleading error message- because stats is 'guessing' to forecast an ets.
model_spec <-
boost_tree() %>%
set_engine("xgboost") %>%
set_mode("classification")
myModel<- workflow() %>%
add_model(model_spec) %>%
add_recipe(shelter_rec) %>%
parsnip::fit(df_train)
# https://parsnip.tidymodels.org/reference/predict.model_fit.html
testPred<-stats::predict(myModel,new_data=df_test)
View(testPred)
before I used stopping_fit as input for stats::predict()...
stopping_fit <- early_stop_wf %>%
finalize_workflow(select_best(stopping_rs, "accuracy")) %>%
last_fit(shelter_split)
whereas stopping_fit could be no real fit ;-).
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.
If you have a query related to it or one of the replies, start a new topic and refer back with a link.