When would you use random forests Vs SVM and why?

When would you use random forests Vs SVM and why?


Support Vector Machine is a supervised learning model which can be used for both classification or regression challenges. However, it is mostly used in classification problems where the data is sparse (easy to classify). We perform classification by finding the hyper-plane that differentiates between the two classes very well .


Random Forest is also one of the most used algorithms in machine learning. It can be used for both classification and regression tasks. The “forest” it builds, is an ensemble of decision trees, usually trained with the “bagging” method. The general idea of the bagging method is to create a combination of learning models which improves the overall result. Basically, Random forest uses multiple decision trees and merges them together to get an accurate and stable prediction.
The basic steps to decide which algorithm to use will depend on a number of factors. Few factors which one can look for are listed below:

  • Number of examples in training set.
  • Dimensions of featured space.
  • Do we have correlated features?
  • Is overfitting a problem?