Random forest is a supervised learning algorithm which is used for both classification as well as regression. … 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.
APPLICATIONS
For the application in banking, Random Forest algorithm is used to find loyal customers, which means customers who can take out plenty of loans and pay interest to the bank properly, and fraud customers, which means customers who have bad records like failure to pay back a loan on time or have dangerous actions.
For the application in medicine, Random Forest algorithm can be used to both identify the correct combination of components in medicine, and to identify diseases by analyzing the patient’s medical records.
For the application in the stock market, Random Forest algorithm can be used to identify a stock’s behavior and the expected loss or profit.
For the application in e-commerce, Random Forest algorithm can be used for predicting whether the customer will like the recommend products, based on the experience of similar customers.
Advantages of Random Forest algorithm
Compared with other classification techniques, there are three advantages as the author mentioned.
For applications in classification problems, Random Forest algorithm will avoid the overfitting problem
For both classification and regression task, the same random forest algorithm can be used
The Random Forest algorithm can be used for identifying the most important features from the training dataset, in other words, feature engineering.
Implementation
from sklearn.ensemble import RandomForestClassifier
classifier = RandomForestClassifier(n_estimators = 20, criterion = ‘entropy’, random_state = 0)
classifier.fit(X, y)