Predicting Loan Credit Worthiness Using Alteryx
Introduction
This project is part of the projects I undertook for my Predictive Analytics for Business with Udacity. I trained multiple Machine learning models using Alteryx. Alteryx is a low-code/no-code Software for data science and analytics. It provides capabilities for ETL, data cleaning, predictive modeling, geospatial modeling, and so much more.
The Business Problem
A small bank recently received an influx of loan applications. The bank needs to figure out out to select the most creditworthy customers. To do this we will use
Key Business Decisions to be made
To solve the problem, we will answer some key questions:
What decisions needs to be made? The business decision that needs to be made here is to determine amongst a new set of customers those whom it will be profitable for the business to approve loans to.
What data is needed to inform those decisions? Data like age, income, loan amount, loan duration of existing customers who have applied for loans in the past, their creditworthiness status that can be used to build a model (the training data) and data on the new customers who are applying for loan
What kind of model (Continuous, Binary, Non-Binary, Time-Series) do we need to use to help make these decisions? Binary models. We want to know if a customer is credit worthy or not.
The Data
I will be using two sets of data for this project,
Data containing historical data of previous loan applicants such as age, dat
Data of present loan applicants
Preparing the Training Data
The build the training data, I did exploratory analysis of the data, checked for data type inconsistencies and choosing the right feature for the model.
I dropped 7 fields during data cleanup. There are two fields with incomplete data in the dataset- The duration in current address and the age fields. During the cleanup process, I dropped the duration in current address field because it has more than more half of its data missing (69%) and data imputation will not be accurate. The Age column has 2% data missing so I imputed with the Median. I dropped the other five fields due to low variation in the data namely foreign workers, guarantors, no of dependents, occupation and telephone as shown in their frequency charts below.

Training the Model
After preparing the data, Next is model training, I used 70% of the model to train and 30% for model validation. I trained the data using the following models:
Logistic Regression
Decision Tree
Forest Model
Boosted Model

Significance Predictor Variables




Model Validation

Logistic Regression: The logistic Regression has an accuracy at 78%, which is strong. PPV= true positives \ (true positives + false positives) = 95 / (95+23) =.81 NPV= true negatives\ (true negatives + false negatives) =22/ (22+10) = .69
Decision Tree model: The decision tree has the lowest accuracy at ~67%, not quite strong. The model is also biased at predicting creditworthiness because the difference between the PPV and NPV is quite high.
PPV= 92 / (92+23) =.75
NPV=22/ (22+17) = .44 Forest Model:This model also has a high accuracy at ~79%, does very well at predicting creditworthiness(the highest accuracy score), it also has the highest f1 score but not so good at predicting non creditworthiness. The evaluation of the confusion matrix below shows the model is not biased.
PPV= 102 / (102+28) =.79 NPV=17/ (17 + 3) = .85
Boosted Model: The boosted model has an accuracy of ~79%, a high precision rate at ~79% it has the least bias though as shown below.
PPV= 101 / (101+28) =.78 NPV=17/ (17+4) = .81
Final Conclusion
I chose the forest model because it has the highest accuracy of all the models. Although the model has a very high accuracy in its overall predictions, it does not have as high accuracy in its predictions of non-creditworthiness. With regards to the confusion matrix, as I have shown in my analysis above, there is not much difference between the NPV and PPV values which indicated that the model is not biased. In terms of the ROC graph (shown below), the model is arguably the highest and the area under the curve while not the highest (it is the second highest) is quite high. Because we are interested only in the accuracy for this problem, the forest model is the best fit.




Comments