- Credit Risk Modelling - Case Studies
- Classification vs. Regression Models
- Case Study - German Credit - Steps to Build a Predictive Model
- Import Credit Data Set in R
- German Credit Data : Data Preprocessing and Feature Selection in R
- Credit Modelling: Training and Test Data Sets
- Build the Predictive Model
- Logistic Regression Model in R
- Measure Model Performance in R Using ROCR Package
- Create a Confusion Matrix in R
- Credit Risk Modelling - Case Study- Lending Club Data
- Explore Loan Data in R - Loan Grade and Interest Rate
- Credit Risk Modelling - Required R Packages
- Loan Data - Training and Test Data Sets
- Data Cleaning in R - Part 1
- Data Cleaning in R - Part 2
- Data Cleaning in R - Part 3
- Data Cleaning in R - Part 5
- Remove Dimensions By Fitting Logistic Regression
- Create a Function and Prepare Test Data in R
- Building Credit Risk Model
- Credit Risk - Logistic Regression Model in R
- Support Vector Machine (SVM) Model in R
- Random Forest Model in R
- Extreme Gradient Boosting in R
- Predictive Modelling: Averaging Results from Multiple Models
- Predictive Modelling: Comparing Model Results
- How Insurance Companies Calculate Risk

## Build the Predictive Model

We have now gathered our data and cleansed/transformed it to suit our modeling needs. The next step is to actually build the model. The goal of predictive modeling is to build a model to predict the future outcomes using statistical techniques.

We use well-known statistical methods (algorithms) to find the function (model) that best describes a dependency between different variables (a.k.a features). The crux of this is to fit a model to the data such that the function we get is able to predict the outcome based on the given features. In our example, Account Balance, Loan Purpose, Telephone, etc are all predictors/features. The creditability is the outcome/response (the value that we are trying to predict). This is also called the target class, response variable or dependent variable.

We create the model using one of the many algorithms that best describes the relationship between the predictors and the response variable. This is also called training the model. Once the model is ready, it can be used to make the prediction for creditability given all the other features of the loan applicant/borrower.

As we have established earlier, the problem we are looking at is a binary classification problem - Creditability as Bad Credit (0) or Good Credit (1).

Below is a list of the popular algorithms used for classification problems.

- Linear Classifiers: Logistic Regression, Naive Bayes Classifier
- Support Vector Machines
- Decision Trees
- Boosted Trees
- Random Forest
- Neural Networks
- Nearest Neighbor

Most often a data scientist will create many models using different algorithms and then use the best or average of all the models. In this case study, we will build the model using just one algorithm, i.e., Logistic Regression.

Unlock full access to Finance Train and see the entire library of member-only content and resources.