Predicting whether Customers will succesfully Repay the Loans or No: Using Decision Tree and Random Forest Model

Click to View Rpubs Report
Click to View Github Code and Datasets

OBJECTIVE

Use RandomForest and DecisionTress to build your model on train data and compare their performance on test data. Also get the variable importance plot for the model.

Evaluation Criterion :Error

Aim here is to build predictive model for predicting whether customers will succeed or fail to repay the loans.

TAGS

Decision Tree, Random Forest Model, Pruning Trees, Terminal Nodes.

PROJECT METHODOLOGY

We will first build decision tree model followed by random forest classification model: The steps followed are given below:

  • Step 1: Data preparation
  • Step 2. Building decision tree model on train data
  • Step 3. Use the model to predict on test dataset and find error
  • Step 4. Prune the tree and find optimised solution.
  • Step 5.Build the model using random forest method.
  • Step 6.Compare and see which model performs better(i.e. gives less error).

DATA DICTIONARY

  • Dataset paydayloan_collections.csv is given to build models.Use dataset "paydayloan_collections.csv" to build a model.
  • It consists of 30,000 observations and 31 variables.
  • Variable names are self explanatory along with the target variable "payment" having values success/denied
  • Evaluation Criterion :Lower Error, better the model.

CONCLUSION

Error generated on by Random forest is 13.20% as against 17.5% by Decision tree model. Hence random forest is little better than decision tree model.

Decision tree with 7 terminal nodes.

Pruned tree plot showing optimised number of nodes.(7 nodes)

Variable Importance plot showing variables 25,17,16,23 as most important variables contributing to the model.

Feel Free To Get In Touch With Me!