loan eligibility using customer data from online applications • Aim: Finding eligible customer segments for personalized outreach by analyzing a dataset • Problem type: Classification Variable Description Str(df) Loan_ID Unique Loan ID chr Gender Male/ Female chr Married Applicant married (Y/N) chr Dependents Number of dependents chr Education Applicant Education (Graduate/ Under Graduate) chr Self_Employed Self employed (Y/N) chr ApplicantIncome Applicant income int CoapplicantIncome Coapplicant income num LoanAmount Loan amount in thousands int Loan_Amount_Term Term of loan in months int Credit_History credit history meets guidelines int Property_Area Urban/ Semi Urban/ Rural chr Loan_Status (Target) Loan approved (Y/N) chr
sampling? No relation between missing variables Rows with more than 2 missing data were omitted and others were imputed 2 Methods (imputing all types of data at the same time) Missing Data pmm cart
variable later on, we figure which variables are impactful with Bayesian roles. In credit history the probability of “bad” given “N” (Loan_Status) is totally different from “good” given “N” (80 to 20 ratio) However, in gender the probability of “femail” given “N” (Loan_Status) is as same as “male” given “N” (30 to 70 ratio) As the ratio of response variable is also 30 to 70, so, gender does not have any influence on response variable Bayesian Method With respect to the methodology that we implemented above, we figure out that only credit history, property, education, and married could be impactful.
credit history is equal to 91% It means if I have good credit history my acceptance probability is more than 90% And the probability of rejection given bad credit history is equal to 73% It means if I have bad credit history my rejection probability is more than 70%
and median of LoanAmount and LoanAmount terms with respect to LoanStatus do not have a significant difference So, they are not relevant Continuous Variables
model performance on the Negative class • Mitigation of bias towards the Positive class • Enhanced model generalization to both classes Improving Model
a new training session is conducted after addressing the class imbalance through upsampling. • Upsampling contributes to improved model generalization and mitigates bias in favor of the majority class. Improving Model
model is exposed to a balanced distribution of classes during training. • we employed a 75-25 train-test split to ensure that our model generalizes well to new, unseen observations. • Our approach combines 5-fold cross-validation and a parallel strategy to efficiently train and validate models. Employing a tuning process at a specified length, possibly related to hyperparameters, helps prevent overfitting. An iterative algorithm refines hyperparameters, aiming to find the optimal set for improved model performance
machine learning models, we have chosen the following models as potential candidates for further consideration: 1- Random Forest (mod1) 2- Ridge Regression (mod2) 3- SVM (mod3) 4- k-Nearest Neighbors(mod4) 5- Naive Bayes(mod5)
(RF) has the highest mean ROC (0.926), making it the top performer. • Random Forest (RF) has the highest mean sensitivity (0.876), indicating better identification of approved loans. • Although Naïve Bayes has better mean of specification (0.95) than Random Forest , It has lowest mean sensitivity with 0.45 , it is obvious that all other model are imbalance • Random Forest (RF) has the mean specificity (0.864) “rsmp <- resamples(list(RF = mod1, KNN = mod2, SVM = mod3, RIDGE = mod4, NAIVE = mod5))summary(rsmp)”
As dot plot illustrates, the combination of SVM, RIDGE, NAÏVE BAYES intersect the zero line and it means that they are not significant in this confidence level (their differences in ROC are not meaningful in concept of statistics). However, combination of RF with others are meaningful since they do not cross the zero line and as it is right hand side of the plot, it shows RF is bigger than all the others in terms of ROC .
up-sample logistic regression reach better result in test data. RF Logistic regression As a result, by comparing the amount of errors in train and test which leads to generalization error we decide to use logistic regression.