Industrial Training




Classification Algorithms - Random Forest


Introduction


Random forest is a supervised learning algorithm which is used for both classification as well as regression. But however, it is mainly used for classification problems. As we know that a forest is made up of trees and more trees means more robust forest. Similarly, random forest algorithm creates decision trees on data samples and then gets the prediction from each of them and finally selects the best solution by means of voting. It is an ensemble method which is better than a single decision tree because it reduces the over-fitting by averaging the result.


Working of Random Forest Algorithm


We can understand the working of Random Forest algorithm with the help of following steps −


  • Step 1 − First, start with the selection of random samples from a given dataset.
  • Step 2 − Next, this algorithm will construct a decision tree for every sample. Then it will get the prediction result from every decision tree.
  • Step 3 − In this step, voting will be performed for every predicted result.
  • Step 4 − At last, select the most voted prediction result as the final prediction result.

The following diagram will illustrate its working −

ml-support-vector-machine


Pros and Cons of Random Forest


Pros

The following are the advantages of Random Forest algorithm −


  • It overcomes the problem of overfitting by averaging or combining the results of different decision trees.
  • Random forests work well for a large range of data items than a single decision tree does.
  • Random forest has less variance then single decision tree.
  • Random forests are very flexible and possess very high accuracy.
  • Scaling of data does not require in random forest algorithm. It maintains good accuracy even after providing data without scaling.
  • Random Forest algorithms maintains good accuracy even a large proportion of the data is missing.

Cons

The following are the disadvantages of Random Forest algorithm −


  • Complexity is the main disadvantage of Random forest algorithms.
  • Construction of Random forests are much harder and time-consuming than decision trees.
  • More computational resources are required to implement Random Forest algorithm.
  • It is less intuitive in case when we have a large collection of decision trees.
  • The prediction process using random forests is very time-consuming in comparison with other algorithms.


Hi I am Pluto.