LendingClub Grade Optimization
Introduction
In 2007, the startup LendingClub became the first peer-to-peer lending platform to offer registered investors the opportunity to purchase personal loans. Borrowers for these loans would apply for an amount between $1,000 - $40,000 and would either be approved or denied by LendingClub. The loans held a term of 3 or 5 years and could be issued for various purposes such as financing a major purchase or debt consolidation. Once approved, the loans would be issued a grade and placed into a catalog for investors to browse.
Investors registered at LendingClub were able to browse the catalog of available loans to determine where they wanted to invest their personal capital. Basic information about the loan, such as remaining principle, interest rate, and remaining term, was provided. LendingClub also provided background information about the borrower, including debt to income ratio, marital status (joint or single loan), and profession. The most important piece of information was the loan grade. The grades were designated by letters A-G, with A being the highest quality loans and G being the lowest. Each grade was also further divided into five sub-grades, such as A1-A5.
The primary risk in investing with LendingClub was that none of the loans were secured by any entity. Investors held all of the risk if the borrowers were to default on their loans. As such, the difference between seeing a good return on the loan or losing one's investment often came down to finding which borrowers were most likely to follow through on their payment plans.
Purpose
The goal of this project was to determine what loans on LendingClub’s platform would provide investors with maximum return on investment. Given that the loans were unsecured, investors needed to be careful to pick loans that would not default before repaying the original investment. Initial investigation into the dataset will prove that higher grades were given to safer loans, and riskier investments received worse grades. However, because riskier loans typically command higher interest rates, it would be possible to take much higher profits on lower grade loans that did follow through with 100% of their payments. This project employed machine learning methods to reprioritize the LendingClub grading system to find the right balance of risk vs reward to maximize investor profits.
Data Preprocessing and EDA
The LendingClub Loan dataset houses information on over two million loans issued from 2007 to 2020. The data consists of 151 features to provide a comprehensive picture of both the loan and borrower.
Before exploring trends in the dataset, all null values had to be addressed. First, I dropped the 33 loans did not have a grade recorded from the dataset. Beyond the missing row data, many of the columns in the dataset had most of their data missing. These features were addressed individually to determine the best method of removing the null values. For the most part, the features were either removed, or their missing data was imputed with an appropriate placeholder.
Once the data had been cleaned, the LendingClub grading system was investigated. The first step to determining if there was any room for improvement on the grading system was to identify how it was established. By looking at the number and percentage of fully paid or charged off loans, it can be clearly seen where LendingClub’s priorities were. Figure 1 showcases the relationship with the charge off percentage and grade.

Figure 1: Fully Paid/Charged Off Loan Count and Percentage by Grade
The first plot in Figure 1 demonstrates the nominal distribution of fully paid and charged off loans LendingClub offered during their peer-to-peer lending tenure. The majority of loans accepted by LendingClub were given higher grades. The second plot in Figure 1 gives a clue as to why this occurred. When looking at the charge off rate of loans by grade, a very clear linear relationship forms. In fact, the relationship has a 99.7% correlation.
Simply put, each drop in grade corresponded to a direct and consistent increase in likelihood of charge off, proving the main objective for LendingClub’s grading scheme was risk prevention. Risk averse investors would find this grading system very helpful, but any investors willing to assume some risk in order to maximize their returns may be leaving money on the table.

Figure 2: Final Earnings Distribution by Grade
Figure 2 shows a curious relationship between profit and grade. As it turns out, the average return for all grades was roughly consistent, just above the break even line. The ‘safe’ loan grades (A-C) had the advantage over the other grades in that the top three quartiles all fell above the breakeven point. This is consistent with the logic determined from Figure 1; the higher grades were more likely to reach fully paid status vs charge off. However, the maximum amount of profit that could be achieved in the safe grades was far lower than the riskier grades. Figures 3 and 4 provide clues to explain this trend.

Figure 4: Interest Rate by Grade
In Figure 3, the distribution of loan amount is seen to increase for the riskier loan grades. Logically, the more money a borrower requests, the harder it will be for them to pay back in full. Additionally, the majority of the lower grade loans were over a longer term, five years as opposed to three. As with a larger principal, longer term loans could be considered more difficult to pay off due to the extended period of financial obligation for the borrower.
To compensate for the liability the investors incur with the riskier loans, lower grade loans are assigned higher interest rates, as seen in Figure 4. When considering only loans that will eventually be paid in full, it is clear that the earning potential is far greater for the lower grades. Higher average loan amounts multiplied by greater interest payments lead to the upper bound trend seen in Figure 2. By this point, it is clear that there is room to improve upon the LendingClub’s gradings scheme. It's a matter of shifting the focus from risk avoidance to maximizing return on investment.
Feature Generation and Predictive Modeling
After establishing evidence of a potentially more lucrative prioritization of LendingClub loans, it was time to turn to predictive modeling. The first step was to determine a variable to predict. Return on investment (feature named ROI) was calculated for all completed loans by dividing the sum of all payments received by the original investment provided. The investor received payments in three forms: principal payment, interest payments, and delinquency payments/fines. While delinquencies are normally a cause for concern for the financial health of the borrower, it is still money collected by the investor. Borrowers who incur delinquencies but end up following through on all payments will end up paying more for their loan. Similar to borrowers who must pay higher interest rates, borrowers who incur delinquency fines but do not default on payment will end up paying the investor more money overall.
For the predictive model stage of this project, the goal was to find a model that accurately predicted the ROI for each loan. To generate the models, the dataset was filtered to only include loans that had status Fully Paid or Charged Off. All other statuses were for loans that were still actively being paid and therefore would continue to increase ROI. Only Fully Paid and Charged Off statuses had reached their final ROI.
After filtering to completed loans, two regression models and two forest models were generated:
- Lasso Regression
- Ridge Regression
- Random Forest
- Random Forest with RandomizedSearchCV
All models used a train-test split of 20%-80% and were evaluated by their train and test R2 scores. The Lasso and Ridge models performed the worst overall, though they had very little bias, both scoring around 79% and 80% for their test and train correlation scores respectively. The random forest models performed far better, though they did fall into more bias. The traditional random forest model scored 94.2% test R2 but had a large amount of bias with a 99.2% train R2. Comparatively, the random forest model using RandomizedSearchCV (to allow fine tuning of parameters) resulted in a 93.9% test R2 and 97.8% train R2. With less of a gap between the train and test data, this model was chosen to predict ROI for the incomplete data.
By applying the predictive model to the incomplete dataset, a new grading criteria could be constructed. The LendingClub dataset provided A grade loans to the top 17.45% of loans, 29.16% to grade B, 28.36% to C, etc., so the new ROI focused grading scheme was divided into the same group sizes. Figure 5 showcases the distribution of LendingClub’s grades for the new top tier grades.

Figure 5: Quantity of Each LC Grade in New ‘A’ Grade
Because the focus of the new A grade was ROI, Figure 5 confirms the predictions stated above. The mid-level LendingClub grades outperform the top grades due to higher earning potential mixed with likelihood of full payment.
Tables 1 and 2 account for the financial impact of using the ROI focused grading scheme over LendingClub’s risk-averse version.
Grade | Dataset % | Avg. ROI | Avg. Profit ($) | Total Profit ($) |
A | 17.45 | 1.053 | 748.89 | 176,099,000.94 |
B | 29.16 | 1.054 | 694.71 | 273,057,075.17 |
C | 28.36 | 1.031 | 391.05 | 149,481,492.19 |
D | 14.96 | 1.013 | 80.62 | 16,252,819.06 |
E | 6.99 | 0.992 | -220.63 | -20,775,556.27 |
F | 2.40 | 0.969 | -739.24 | -23,872,946.23 |
G | 0.69 | 0.913 | -1746.23 | -16,264,382.13 |
Table 1: LendingClub’s Grading Scheme Performance
Dataset % | Avg. ROI | Avg. Profit ($) | Total Profit ($) |
17.45 | 1.310 | 6,103.63 | 1,435,548,538.10 |
29.16 | 1.165 | 2,055.13 | 807,719,246.37 |
28.36 | 1.084 | 750.88 | 287,018,736.91 |
14.96 | 0.846 | -1578.91 | -318,360,674.62 |
6.99 | 0.380 | -9,061.56 | -853,707,915.30 |
2.40 | 0.190 | -17,265.89 | -558,482,531.63 |
0.69 | 0.066 | -26,807.82 | -245,720,507.60 |
Table 2: ROI Focused Grading Scheme Performance
The difference in performance between Tables 1 and 2 is substantial for investors looking to maximize their profits. With an average profit of over $6,000 compared to just $750 for A grade loans, it is clear that the LendingClub grading system is not optimized and that the new model can help investors maximize their earning potential.
Future Work
Unfortunately there were some limiting factors with this project that require additional time and resources to overcome. First, the size of the dataset created a challenge with model generation because all two million loans could not efficiently be analyzed in the same model. Several subsets of 10,000 loans each were used to develop a reasonably accurate prediction of ROI. With greater computing power, all loans could be used to hopefully improve the performance of the model. Additionally, this project did not dive into sub-grades, which could provide further nuance for loan selection.