
Learn to model credit risk using R programming with logistic regression and decision trees, from data preprocessing in RStudio to model validation and interpretation under IRB.
Explore a 20-attribute dataset to predict credit worthiness, learn variable meanings from account balance to foreign worker, and prepare for credit risk modeling with R.
Select data for a credit risk model in R Studio, using predictor variables like personal details, credit history, and behavioral data to model the probability of default with logistic regression.
Select the bank credit scoring dataset, pre-process data, perform feature selection and redundancy removal, then train and evaluate a classification model with a train-test split to assess accuracy.
Preprocess data for credit risk modeling in R by importing the dataset with read.csv(file.choose), inspecting structure, addressing outliers and missing values, and converting numeric vars to factors.
Convert integers to factors and drop numeric variables to prepare a credit score data frame for modeling in R, then split into training and testing sets with a 70/30 approach.
Build a logistic regression model to predict creditability using selected predictors from the credit_train data, splitting training and test sets for a binary classification of good or bad credit.
In logistic regression model 2, learn to compute the probability of good credit (Y=1) from coefficients and intercept, then predict new applicants and apply a 0.6 threshold to classify creditability.
Fit the logistic regression model on training data, generate predictions for credit_test, visualize predicted probabilities, and convert them into 0/1 class labels using a 0.6 threshold to identify defaults.
Apply a 0.6 threshold to predicted probabilities to generate zero-one labels, then fit and evaluate a credit risk model in R using the CR package for ROC and AUC analyses.
Explain the confusion matrix and its elements (true positives, false positives, true negatives, and false negatives) and derive accuracy, precision, recall, and F-score for credit risk modeling in R.
Explore AUC and ROC curves to assess classification performance, including multi-class scenarios, thresholds, and the roles of sensitivity and specificity in distinguishing classes.
Explore how to compute and plot the ROC curve using a performance object, interpret TPR and FPR, and assess model performance with AUC, accuracy, and cutoffs.
Compute the confusion matrix in rstudio with the carrot package, using creditability and a test set to assess accuracy, sensitivity, and specificity.
Compute the expected loss from PD, Ed, and LGD, and explore default, exposure at default, and loss given default under Basel's IRB framework with an example.
Explore data for a probability of default model in r by importing Lending Club loan data, inspecting 145 variables across 133,889 observations, and preparing loan status for binary default prediction.
Explore the loan data structure and derive descriptive statistics with summary, transform loan status to default versus not default, and count loans by status using group_by and summarize.
Collapse charged off and default into a single default category and keep fully paid as not default; use str_detect and if_else to create two loan_status states and summarize with group_by.
Visualize loan status with a ggplot2 bar chart showing default and fully paid counts. Use dplyr to compute default counts and default rates by grade from A to G.
Analyze how default rates rise from grade A to G using dplyr and ggplot2, and show that higher risk corresponds to higher interest rates.
Install and load key R packages such as dplyr, stringr, ggplot2, caret, lubridate, and xgboost to analyze data, visualize results, and build models.
split the loan data into training and testing datasets using the sample command, reserving 70% for training and 30% for testing to build and evaluate a credit risk model.
Discard irrelevant attributes to sharpen loan default predictions, then clean and prepare the dataset. Remove non-predictive variables, drop redundant grid information, and impute missing values with medians.
Remove unused variables and reduce from 94 to 81. Convert reveal_util to numeric by stripping percent sign and transform earliest_credit_line to days before loan issuance; inspect default rate by month.
Identify and remove zero-variance predictors in a credit risk dataset using R, define helpers to extract numeric, character, and factor columns, and drop the zero-variance feature policy_code.
Learn to compute statewise loan default rates, filter for sufficient sample sizes, and rank states to identify the five highest and five lowest defaults using dplyr in R.
Explore how correlation among features affects predictive models, learn to compute Pearson correlation coefficients, identify and remove highly correlated variables, and visualize a correlation matrix with core plot in R.
Learn how to transform numeric features by ratios, identify numeric and character columns, and prune variables in an R data frame for credit risk modeling.
Develop a credit risk model for probability of default by applying logistic regression, using caret preprocess to center and scale data, and prune features by p-values with a 0.01 alpha.
Every time an institution extends a loan, it faces credit risk. It is the risk of economic loss that every financial institution faces when an obligor does not fulfill the terms and conditions of his contracts. Measuring and managing the credit risk and developing, implementing strategies to help lowering the risk of defaults by borrowers becomes the core of any risk management activities.
Financial institutions make use of vast amounts of data on borrowers and loans and apply these predictive and statistical models to aid banks in quantifying, aggregating and managing credit risk across geographies and product lines.
In this course, our objective is to learn how to build these credit risk models step by step from scratch using a real life dataset.
The course comprises of two sections: 1) Developing a credit risk scorecard and 2) Developing a Probability of Default (PD) model. We will build a predictive model that takes as input the various aspects of the loan applicant and outputs the probability of default of the loan applicant. PD is also the primary parameter used in calculating credit risk as per the internal ratings-based approach (under Basel guidelines) used by banks.
In this course, we will perform all the steps involved in model building and along the way, we will also understand the entire spectrum of the predictive modeling landscape.