NYC Data Science Academy| Blog
Bootcamps
Lifetime Job Support Available Financing Available
Bootcamps
Data Science with Machine Learning Flagship ๐Ÿ† Data Analytics Bootcamp Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lesson
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories Testimonials Alumni Directory Alumni Exclusive Study Program
Courses
View Bundled Courses
Financing Available
Bootcamp Prep Popular ๐Ÿ”ฅ Data Science Mastery Data Science Launchpad with Python View AI Courses Generative AI for Everyone New ๐ŸŽ‰ Generative AI for Finance New ๐ŸŽ‰ Generative AI for Marketing New ๐ŸŽ‰
Bundle Up
Learn More and Save More
Combination of data science courses.
View Data Science Courses
Beginner
Introductory Python
Intermediate
Data Science Python: Data Analysis and Visualization Popular ๐Ÿ”ฅ Data Science R: Data Analysis and Visualization
Advanced
Data Science Python: Machine Learning Popular ๐Ÿ”ฅ Data Science R: Machine Learning Designing and Implementing Production MLOps New ๐ŸŽ‰ Natural Language Processing for Production (NLP) New ๐ŸŽ‰
Find Inspiration
Get Course Recommendation Must Try ๐Ÿ’Ž An Ultimate Guide to Become a Data Scientist
For Companies
For Companies
Corporate Offerings Hiring Partners Candidate Portfolio Hire Our Graduates
Students Work
Students Work
All Posts Capstone Data Visualization Machine Learning Python Projects R Projects
Tutorials
About
About
About Us Accreditation Contact Us Join Us FAQ Webinars Subscription An Ultimate Guide to
Become a Data Scientist
    Login
NYC Data Science Acedemy
Bootcamps
Courses
Students Work
About
Bootcamps
Bootcamps
Data Science with Machine Learning Flagship
Data Analytics Bootcamp
Artificial Intelligence Bootcamp New Release ๐ŸŽ‰
Free Lessons
Intro to Data Science New Release ๐ŸŽ‰
Find Inspiration
Find Alumni with Similar Background
Job Outlook
Occupational Outlook
Graduate Outcomes Must See ๐Ÿ”ฅ
Alumni
Success Stories
Testimonials
Alumni Directory
Alumni Exclusive Study Program
Courses
Bundles
financing available
View All Bundles
Bootcamp Prep
Data Science Mastery
Data Science Launchpad with Python NEW!
View AI Courses
Generative AI for Everyone
Generative AI for Finance
Generative AI for Marketing
View Data Science Courses
View All Professional Development Courses
Beginner
Introductory Python
Intermediate
Python: Data Analysis and Visualization
R: Data Analysis and Visualization
Advanced
Python: Machine Learning
R: Machine Learning
Designing and Implementing Production MLOps
Natural Language Processing for Production (NLP)
For Companies
Corporate Offerings
Hiring Partners
Candidate Portfolio
Hire Our Graduates
Students Work
All Posts
Capstone
Data Visualization
Machine Learning
Python Projects
R Projects
About
Accreditation
About Us
Contact Us
Join Us
FAQ
Webinars
Subscription
An Ultimate Guide to Become a Data Scientist
Tutorials
Data Analytics
  • Learn Pandas
  • Learn NumPy
  • Learn SciPy
  • Learn Matplotlib
Machine Learning
  • Boosting
  • Random Forest
  • Linear Regression
  • Decision Tree
  • PCA
Interview by Companies
  • JPMC
  • Google
  • Facebook
Artificial Intelligence
  • Learn Generative AI
  • Learn ChatGPT-3.5
  • Learn ChatGPT-4
  • Learn Google Bard
Coding
  • Learn Python
  • Learn SQL
  • Learn MySQL
  • Learn NoSQL
  • Learn PySpark
  • Learn PyTorch
Interview Questions
  • Python Hard
  • R Easy
  • R Hard
  • SQL Easy
  • SQL Hard
  • Python Easy
Data Science Blog > Capstone > Increasing ROI for Investors Using LendingClub as an Example

Increasing ROI for Investors Using LendingClub as an Example

Theodore and Ali
Posted on Jan 15, 2022

The skills the authors demonstrated here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

INTRODUCTION

There are many avenues to investing which can be research through data. Each type of investment vehicle comes with a different risk-return profile. For the most risk-averse,  higher interest savings accounts or CDs guarantee safety. Investors who seek a greater return and are willing to take on the risk of loss would likely invest in the stock market or mutual funds that invest in stocks, real estate, or REITs.

Those who seek alternative avenues to boost their investment returns or to diversify their portfolios beyond those standard investments, thereโ€™s also the option of capitalizing on the return of peer-to-peer loan investments which can yield a decent return while mitigating unnecessary risk. 

However, investing in loans may not be the easiest to navigate with so many aspects of the loan, and the borrower to consider that the investor must understand before making an educated judgment. This analysis utilizes past data from LendingClub, the most popular online peer-to-peer lending platform since 2006 as an example to study return on investments. 

BACKGROUND

Each loan is assigned a grade based on the borrower's FICO score, income, house ownership, and various other data the applicant fills out. We can see how many loans have a particular grade in Graph 1.

Graph 1: Growing Popularity with the Evolution of LendingClub
Graph 2: Violin Chart Showing Distribution of Interest Rates based on Their Grades and Terms

It can be observed that as the quality of the loan deteriorates, the chance of default increases. The investors would, therefore, require a higher interest rate to compensate for the possible loss of their capital. From the above graphs, we can predict that each loanโ€™s return on investment can greatly differ depending on its grade.

Graph 3: Count of Loan Applications by Selected Purposes from 2013-2018

Sometimes even the purpose of the loans can have an impact on returns due to different risk levels. For example, LendingClub rates are usually lower than normal credit card interest rates, making it easier for the borrowers to pay off their debt. On the other hand, rates are most likely higher at LendingClub than a typical mortgage or small business loan from traditional banks, hence chances of default would increase.

The underlying reasons for these patterns could have different impacts on the loan outcomes, but a simple analysis of the data may not show a complete picture. If an investor is able to get their hands on a credit report, there will be many features for them to take into consideration. In the current dataset, there are more than 150 features, including the grades, purposes, terms. We aim to reduce the complexity of selecting more profitable loan investments for new (and even experienced) investors.

PURPOSE

Our aim is to increase the ROI for investors who decide to invest in LendingClub loans by using machine learning models. Thus we will be able to save investors time, money, and stress while helping them make better decisions for their future.

The dataset we are using contains information for over 2 million loans and the 151 features that affect the outcome of the loan. Based on these numbers alone, it is apparent that classifying these loans can be a tricky and time-consuming task for a less-experienced investor. There are loans that look like they would do well and provide a decent ROI but end up defaulting. There are also loans that are paid off too early and do not provide a decent ROI.

Consequently, it is no simple matter to predict which loans will pay off the most even based on unique features. Our models predict which loans will end up being paid off and are more likely to provide a decent return. In order to reduce work, we used classification and confusion matrices to give a sense of direction. 

METHOD

DATASET

First, we split data evenly into train and predict sets using only completed loans (loans with a definitive outcome of having been fully paid off or defaulted). Training data was used for the entire process, but the prediction dataset was only used to confirm our results. 

BALANCING

After splitting the dataset, we balanced each dataset since labels were not split evenly. We ran our models after converting some features to numeric type to ease the load on RAM usage. Then we extensively engineered some features (for example ratios of income to monthly payment or income to loan amount) and realized that there was not much improvement in the ROC-AUC scores, which we used to measure accuracy. 

Next, we reduced the features to create a minimal dataset to see if there were any glaring differences in the ROC-AUC scores. The reduced dataset performed similarly in terms of accuracy to the larger datasets with extensive feature engineering, scoring only about 1% less than the original dataset and the dataset with extensive feature engineering. The train and test scores for the 3 datasets are shown in Table 1.

Table 1: ROC-AUC Scores of Original Data, Feature Engineered Data, and Reduced Data Using SKLearnโ€™s Gradient Boosting Regressor Model 

FINAL DATASET

We were able to simplify the final dataset to include only 8 features. Those features are as follows: annual income, FICO Score, duration of the loan, the loan amount, homeownership status, the interest rate of the loan, the utilization rate of all credit lines, and debt-to-income ratio.

MODEL COMPARISON

To compare the performance of different machine learning models and to find the best model, we tested and tuned 3 different machine learning models including random forest classification, gradient boosting classification, and XGBoost classification. 

CONFUSION MATRIX

We were able to achieve a ROC-AUC score in the range of 65-71% for our train sets. After checking the ROC-AUC scores, we used confusion matrices to see how possible outcomes were split.

Table 2 shows the confusion matrix of an un-tuned Gradient Boosting Classifier for our prediction dataset. Our labels were 0 to indicate paid off and 1 to indicate default. A total of 674,049 loans were analyzed, which is the sum of all quadrants. The top left quadrant of our confusion matrix is our true positive (TP), where we see 361,451 loans (53.6%) both actually paid off and predicted to be paid off by our models.

The top right quadrant of 177,918 loans (26.4%) is our false positive (FP), which was predicted to default but was actually paid off. Our true negative (TN) quadrant on the bottom right shows 85,225 loans (12.6%) that were defaulted and that our model predicted to default as well. The bottom left quadrant shows the false negative (FN) of 49,455 loans (7.3%) that our model predicted being paid off but the loan ended up actually defaulting. 

This results in 66% overall accuracy, 65% sensitivity, and 66% specificity, where the sensitivity of a classifier is defined as TP/(TP+FN) and specificity is defined as TN/(TN+FP).

Table 2: Confusion Matrix of Un-Tuned Gradient Boosting Classifier for Prediction Set

SIMULATION

We simulated the behavior of an investor looking to invest in 4 loans at random. The simulated investor would have 6 portfolios ranging from $1 - 60,000 in increments of $9,999. We applied the 3 best ML models as well as naive random sampling where no models were used in selecting the loans. We ran 10,000 iterations in this simulation to get the weighted average ROI.

RESULTS

In Graph 4, we can see a clear increase of ROI with the investor's portfolio when using our models compared to the naive sampling using no model. An increase of 20 - 120% in profit between using our model vs naive sampling was observed. The higher the investment, the more critical the need for implementing the model to ensure ROI does not decrease. 

Graph 4: ROI Comparison Between Actual Outcome and Model-Predicted Outcomes

The decreasing trend of the ROI for naive sampling makes sense because higher investment ranges would require on average larger loans to be picked. As we can see from the boxplot in Graph 5, larger loans are often associated with lower grades, ie. grade F and G, which is correlated with a higher rate of default. Without any models to aid in the loan selection process, naive sampling would pick those loans with lower grades at random, increasing the rate of default. Overall, this would equate to decreasing the return on investment.

Graph 5: Boxplot of Loan Amount in Dollars Grouped by Grade

FUTURE IMPLEMENTATIONS

Until now, we only figured out a way to ensure that investors would be able to see an increase in returns. An easy-to-use app could be created to allow for user input of the investment range, the number of loans, the loan grades they are comfortable with, and the purposes of the loans.  We can also revisit feature engineering and focus more on the features that have a greater impact on model prediction to increase our modelsโ€™ performance to provide even better results for investors.

About Authors

Theodore

Theodore is a jack of many trades and an expert in overthinking. He has worked in healthcare, healthcare administration, and finance and has experience in medical research. Having volunteered with medical missions abroad, managed building a new primary...
View all posts by Theodore >

Ali

View all posts by Ali >

Leave a Comment

No comments found.

View Posts by Categories

All Posts 2399 posts
AI 7 posts
AI Agent 2 posts
AI-based hotel recommendation 1 posts
AIForGood 1 posts
Alumni 60 posts
Animated Maps 1 posts
APIs 41 posts
Artificial Intelligence 2 posts
Artificial Intelligence 2 posts
AWS 13 posts
Banking 1 posts
Big Data 50 posts
Branch Analysis 1 posts
Capstone 206 posts
Career Education 7 posts
CLIP 1 posts
Community 72 posts
Congestion Zone 1 posts
Content Recommendation 1 posts
Cosine SImilarity 1 posts
Data Analysis 5 posts
Data Engineering 1 posts
Data Engineering 3 posts
Data Science 7 posts
Data Science News and Sharing 73 posts
Data Visualization 324 posts
Events 5 posts
Featured 37 posts
Function calling 1 posts
FutureTech 1 posts
Generative AI 5 posts
Hadoop 13 posts
Image Classification 1 posts
Innovation 2 posts
Kmeans Cluster 1 posts
LLM 6 posts
Machine Learning 364 posts
Marketing 1 posts
Meetup 144 posts
MLOPs 1 posts
Model Deployment 1 posts
Nagamas69 1 posts
NLP 1 posts
OpenAI 5 posts
OpenNYC Data 1 posts
pySpark 1 posts
Python 16 posts
Python 458 posts
Python data analysis 4 posts
Python Shiny 2 posts
R 404 posts
R Data Analysis 1 posts
R Shiny 560 posts
R Visualization 445 posts
RAG 1 posts
RoBERTa 1 posts
semantic rearch 2 posts
Spark 17 posts
SQL 1 posts
Streamlit 2 posts
Student Works 1687 posts
Tableau 12 posts
TensorFlow 3 posts
Traffic 1 posts
User Preference Modeling 1 posts
Vector database 2 posts
Web Scraping 483 posts
wukong138 1 posts

Our Recent Popular Posts

AI 4 AI: ChatGPT Unifies My Blog Posts
by Vinod Chugani
Dec 18, 2022
Meet Your Machine Learning Mentors: Kyle Gallatin
by Vivian Zhang
Nov 4, 2020
NICU Admissions and CCHD: Predicting Based on Data Analysis
by Paul Lee, Aron Berke, Bee Kim, Bettina Meier and Ira Villar
Jan 7, 2020

View Posts by Tags

#python #trainwithnycdsa 2019 2020 Revenue 3-points agriculture air quality airbnb airline alcohol Alex Baransky algorithm alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus ames dataset ames housing dataset apartment rent API Application artist aws bank loans beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep boston safety Bundles cake recipe California Cancer Research capstone car price Career Career Day ChatGPT citibike classic cars classpass clustering Coding Course Demo Course Report covid 19 credit credit card crime frequency crops D3.js data data analysis Data Analyst data analytics data for tripadvisor reviews data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization database Deep Learning Demo Day Discount disney dplyr drug data e-commerce economy employee employee burnout employer networking environment feature engineering Finance Financial Data Science fitness studio Flask flight delay football gbm Get Hired ggplot2 googleVis H20 Hadoop hallmark holiday movie happiness healthcare frauds higgs boson Hiring hiring partner events Hiring Partners hotels housing housing data housing predictions housing price hy-vee Income industry Industry Experts Injuries Instructor Blog Instructor Interview insurance italki Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter las vegas airport lasso regression Lead Data Scienctist Lead Data Scientist leaflet league linear regression Logistic Regression machine learning Maps market matplotlib Medical Research Meet the team meetup methal health miami beach movie music Napoli NBA netflix Networking neural network Neural networks New Courses NHL nlp NYC NYC Data Science nyc data science academy NYC Open Data nyc property NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time performance phoenix pollutants Portfolio Development precision measurement prediction Prework Programming public safety PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn seafood type Selenium sentiment analysis sentiment classification Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau teachers team team performance TensorFlow Testimonial tf-idf Top Data Science Bootcamp Top manufacturing companies Transfers tweets twitter videos visualization wallstreet wallstreetbets web scraping Weekend Course What to expect whiskey whiskeyadvocate wildfire word cloud word2vec XGBoost yelp youtube trending ZORI

NYC Data Science Academy

NYC Data Science Academy teaches data science, trains companies and their employees to better profit from data, excels at big data project consulting, and connects trained Data Scientists to our industry.

NYC Data Science Academy is licensed by New York State Education Department.

Get detailed curriculum information about our
amazing bootcamp!

Please enter a valid email address
Sign up completed. Thank you!

Offerings

  • HOME
  • DATA SCIENCE BOOTCAMP
  • ONLINE DATA SCIENCE BOOTCAMP
  • Professional Development Courses
  • CORPORATE OFFERINGS
  • HIRING PARTNERS
  • About

  • About Us
  • Alumni
  • Blog
  • FAQ
  • Contact Us
  • Refund Policy
  • Join Us
  • SOCIAL MEDIA

    ยฉ 2025 NYC Data Science Academy
    All rights reserved. | Site Map
    Privacy Policy | Terms of Service
    Bootcamp Application