Lending Club has over  2.2 Million  available loans. Where should you invest?
Published: 2022-04-26 17:48:41

## The Problem

Peer-to-peer lending is and was an investment system with both high risk and a high reward. Peer-to-Peer lending was made possible due to the far-reaching nature of the Internet -- people can connect from all across the globe and request money without the need for corporate banks or credit unions. The system benefitted both the lendees and the lenders: the lendees had the ability to receive loans that may have otherwise been denied by a bank and individual lenders now had the ability to invest in individuals rather than corporations.

While peer-to-peer lending has the possibility large gains, it also has the possibility for huge losses. One loan that is defaulted can hurt a lender more than multiple loans that do get paid back. That's why when making the decision about who to loan money to, it is important to consider both the chance of default (risk) and interest rate (reward) for a given opportunity. 

## Our Solution

My team, Beta2, set out to solve this problem by utilizing historic data from peer-to-peer lending platform Lending Club. We initially started with the question: which loans generate the most money for a given lender? The obvious answer here are the loans with the highest interest rates. A higher interest rate means more money for an individual investor, right? Well, yes, kind of. 

While higher interest rates can directly lead to a higher return for an investor, it is important to remember that higher interest rates were likely assigned to a given loan due to its high risk. Lending Club assigns "grades" to a given loan to assess the risk and assign an interest rate.

![The Status Quo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/l80cxgbs4crfbwb6yu6u.png)

Our goal as a group was to use historic Lending Club data to create a model that can predict interest rate for a given loan and compare it to the assigned interest rate given by Lending Club. A large difference between Beta2's calculated interest rate and Lending Club's assigned interest rate would mean large gains at a low risk to a given lender. By finding this difference we hope to capitalize on arbitrage and beat the market.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mvgvsll2e0sh324o7484.png)

Our team trained a logistic regression model that classifies loans as either high-quality or low-quality -- a loan that was accepted by LendingClub and never defaulted was labeled as high-quality and a loan that rejected by LendingClub or was accepted and then defaulted was labeled as low-quality. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tk5xl58gdswu9o1hbnsp.png)

The Beta2 team now input current LendingClub loans into the model, and selected only the "high-quality" loans. Our team then calculated the "strength" of the high-quality loan by finding the distance between a particular loan and the  hyperplane. The farther a "high-quality" loan was from the hyperplane, the higher quality the loan was -- according to the model. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4civ31zioivq7zntl7uw.png)

This distance became the "loan score". Our team converted this loan score into an interest rate by normalizing both our loan score variable and the full range of interest rates from lending club. We found that our model was much more conservative when assigning interest rates than LendingClub's model was.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zrz696m6lr1l17h0knwr.png)

In order to provide our client with the most profit, we wanted to find loans that our model assigned the lowest interest rate (low risk) but got assigned the highest interest rate (high risk) by LendingClub. Our team worked to catch Lending Club's mistake, allowing our client to find loans that LendingClub saw as high risk but we calculated were actually low risk investments. In order to achieve this, we calculated the difference between LendingClub's interest rate and our interest rate, and we provided our client with the loans that maximized this value.  

Our team was able to provide the client with over 300 loans with a high interest rate and a low risk of default. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/b0ss87lrn69gv8yylqsv.png)

---
## What I Learned

When I first decided to take BUSI 488, I knew that I had an interest in data science, but I wasn't aware at the vast amount of functional knowledge that I would gain about business in such a short time. Throughout my time in the CS department, I have learned how to write clean and condensed code, optimize functions to run more efficiently, and work on large codebases. Never had I needed to apply any of these skills to a real business problem, however. Working on a team filled with half business majors and half CS majors allowed each of us to learn from each other. BUSI 488 has been an incredibly influential class during my time here at UNC, and I would like to thank Dr. D for all that he has done for his students.