In this topic we would implement Random Forest classifier, using Python. We would try to understand practical application of Random Forest and codes used for classifier. As we have understood in our previous topic a random forest classifier is a group of decision tree classifier. We will also see as we increase the number of trees, the predictive power of the Random Forest classifier increases.
We would use Loan Default data to implement Random Forest Classification.
Step 1: Import the Libraries. We would use three libraries for this analysis:
Use below command to import the libraries.
Step 2: Importing the data set
Step 3: Splitting the data set into the Training set and Test set
Step 4: Feature Scaling
Step 5: Fitting Random Forest Classification to the Training set
Step 6: Predicting the Test set results
Step 7: Making the Confusion Matrix