- when predicting the test sets in cross validation splits using randomforest function, it returns NA for all values in the response variable .
here is the code I used for building the model:
cv_model_tunerf <- cv_tune %>%
mutate(model = map2(.x = train, .y = mtry, ~randomForest(formula = main_cat ~ . - sample_no., data = .x, ntree = 500, mtry = .y, importance = TRUE, na.action=na.roughfix, seed = 12345)))
it works well. - here is the code I used for prediction
cv_pred_rf <- cv_models_tunerf %>%
mutate(validate_predicted = map2(.x = model, .y = validate, ~predict(.x, .y)))
it returned NA for all predicted values.
note: the dataset I am working on contains many misssing values.
thank you in advance.
This topic was automatically closed 21 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.