Random forests is another supervised learning algorithm that uses ensembles of decision trees to make many class predictions so that the most frequently called class becomes the model's final prediction. Random forests is useful generally as it will work with categorical and numerical data together and can be applied to classification and regression, and we'll use it again for predicting the most important variables in our data in the Identifying the most important variables in data with random forests recipe in this chapter. In this recipe, we'll use random forests to predict classes of data.
Predicting classes with random forests
Getting ready
For this recipe, we'll need the caret and randomForest packages...