June 2017
Beginner to intermediate
576 pages
15h 22m
English
Next, we have similar code for the test data group. Set the grp flag to 0 to designate this is from the test group:
#run predictions on test dataset based on training modelpreds_test <- predict(model, test)preds_test$grp <- 0preds_test$totrows = nrow(preds_test)
Print a few rows from the results using the SparkR select function to extract several key columns:
head(SparkR::select(preds_test,preds_test$outcome,preds_test$prediction,preds_test$grp,preds_test$totrows))
