I want to predict on new data that contain NA rows. I need to keep these rows to have the same number of rows in input data and prediction outputs. How can I do this with a random forest model trained with R Caret ? I tried different values for the argument na.action of predict function, for example :
predictions = predict(RF_model, newdata = newdata, type = "prob", na.action = "na.exclude")
With na.exclude and na.omit the rows are deleted. With na.pass I've got an error output "missing values".
EDIT : the model has already been trained, we are talking about predictions on completely new data, and some of them are not good. I know we can't predict on these bad data, but I need to keep a track of the rows.