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 > R > Data Visualization of U.S Retail Consumer Banking Complaints

Data Visualization of U.S Retail Consumer Banking Complaints

Nanda Rajarathinam
Posted on Aug 8, 2016
The skills the author demoed here can be learned through taking Data Science with Machine Learning bootcamp with NYC Data Science Academy.

Objective and Motivation

All of us have a relationship with a financial institution. At a minimum, most of us have a checking account and a credit card, while others might have various loan related products. Irrespective of the type of product, retail consumers have long term relationships with their banks / financial institutions. The app described here provides a tool to analyze the data on the effectiveness of these financial relationships and compares these across banks and other financial service providers.

One of the commonly used industry metrics for measuring consumer satisfaction is to look at how consumer complaints are resolved over time. This Shiny app does just that.  It can be used by the general public / consumers to look at the complaint volume and uncover insights around delayed, disputed responses and their trends over time. These insights can help consumers be better prepared to assess the relative performance of financial institutions.

The Shiny app can be accessed at https://nrathnam.shinyapps.io/consumer_complaint/

Dataset & Cleaning

The data comes from the website of the Consumer Financial Protection Bureau (CFPB) which is a Federal agency responsible for protecting the rights of retail consumers. The Consumer Complaint Database (CCD) is a centralized repository that stores the log of various complaints filed by the consumers starting 2011. The data is available in the form of a text file and includes the following information: type of product, issue faced by the consumer, whether the complaint was resolved on time, whether the response was disputed by the consumer.

The analysis focuses on years 2012 to 2015, the only years for which CCD has complete data.  Minimal data manipulation was required to standardize variable names, perform data type conversion and derive the Complaint date variable.

The R code is available in my GitHub repository :  https://github.com/nycdatasci/bootcamp006_project/tree/master/Project2-Shiny/NandaRajarathinam

Overview of the Consumer Complaints Data Analysis App

There are 6 tab pages in the application:

  • Complaints trend tab provides an overview of the volume of complaints by year;
  • Response trend tab shows the trend in responses provided by the firms (including percentage of delayed and disputed responses);
  • Top Issues tab shows the list of top 5 issues based on the volume of complaints;
  • Companies tab displays the response metrics by firms;
  • Map tab provides a visual depiction of of the response metrics by state;
  • Data tab shows the consumer complaint data in a tabular format.

The Welcome page provides a basic overview of the app and some background around the consumer complaint database.

Welcome

 

Complaints Data Trend

The Complaints Trend page displays the trend in the number of complaints filed based on the financial products or services offered by the firms. This chart depicts a rising trend in the complaint volume for most of the products except mortgage. The user can select multiple products from the checkbox and the plot will refresh to display the trend for those products. We can also see that Mortgage and Debt Collection account for almost 50% of the total number of complaints filed.

Complaint Trend

 

Response Data Trend

The Response Trend graph displays the trend in the responses received from the financial institutions based on the products selected. The user can select the products to compare the trend in delayed responses, disputed responses and responses that were resolved with monetary relief. The percent of delayed responses were below 2% for most of the products except Debt Collection which had more delayed responses. Overall, the delays were found to be within reasonable limits considering the volume of complaints handled. The R code used for rendering the plot on the server is shown below.

Response Trend - Delayed

Looking at the Disputed responses plot, one can immediately see that the percent of disputed responses jumps to low 20's compared to the 2% to 6% range for Delayed response plot. On an average, 23% of the responses were disputed across products and there was a strong relation between the way a complaint was resolved and a response being disputed. In general, consumers tend to dispute the bank's response if their case was closed without any relief.

Response Trend - Disputed

### Code for Insight: Responses tab
choiceResponseInsight <- reactive({
capitalize(input$responseInsightRB)
})
output$txtResponseInsight <- renderText({
if (choiceResponseInsight() == "% Disputed Responses") { "Percentage of Disputed Responses" }
if (choiceResponseInsight() == "% Delayed Responses") { "Percentage of Delayed Responses" }
if (choiceResponseInsight() == "% Cases closed with Monetary Relief") { "Percentage of Cases closed with Monetary Relief" }
print (choiceResponseInsight())
})
graphInputInsight <- reactive({
# Choosing information based on widget inputs
print (input$productInsightCG)
if (input$responseInsightRB == "% Disputed Responses") { graphdat <- reshaped_disputed_response }
if (input$responseInsightRB == "% Delayed Responses") { graphdat <- reshaped_late_response }
if (input$responseInsightRB == "% Cases closed with Monetary Relief") { graphdat <- reshaped_monetary_relief }
i = c()
if ("Bank account or service" %in% input$productInsightCG) {
i[length(i)+1] = 2
}
if ("Consumer Loan" %in% input$productInsightCG) {
i[length(i)+1] = 3
}
if ("Credit card" %in% input$productInsightCG) {
i[length(i)+1] = 4
}
if ("Credit reporting" %in% input$productInsightCG) {
i[length(i)+1] = 5
}
if ("Debt collection" %in% input$productInsightCG) {
i[length(i)+1] = 6
}
if ("Money transfers" %in% input$productInsightCG) {
i[length(i)+1] = 7
}
if ("Mortgage" %in% input$productInsightCG) {
i[length(i)+1] = 8
}
if ("Student loan" %in% input$productInsightCG) {
i[length(i)+1] = 9
}
firstcol = 1
print(i)
i = c(firstcol, i)
print(i)
graphdat = graphdat[, c(i)]
return (data.frame(graphdat))
})
# Graphing data of interest
output$plotInsight <- renderGvis({
gvisLineChart(
graphInputInsight(), options=list(
lineWidth=3, pointSize=5,
vAxis="{title:'Response Metric' , format:'#.##%' }",
hAxis="{title:'Year', format:'#####'}",
width=750, height=500))
})
view raw graph_responses hosted with โค by GitHub

Top Issues

This graph displays the top 5 issues faced by consumers for a given product and year. In most cases these top 5 account for 60% of all complaints for that product.  For Mortgage and Debt Collection the most common complaint are:  Loan modification, foreclosure, escrow payments and attempts to collect debt that are not owed.

Top Issues

 

Companies

This page displays the response metrics (Delayed & Disputed) for a given product filtered by the bank tier and the year. We can see that the top tier banks, Bank of America, JPMorgan Chase and Wells Fargo, have on average a 20% dispute percentage across the board. The Tier 2 and 3 institutions have a relatively higher average dispute percentage compared to the big three Tier 1 banks.   This may be due to the fact that the larger banks have established procedures in place and have the ability to assign more resources to handle complaints.

Companies complaint

Maps & Data

The Maps page provides a country wide visualization of the response related metrics that we have seen in previous pages. The Data tab displays the consumer complaint data that was used for this analysis. The user can hover the mouse over the states and the graph displays the metrics for that state. In general, states that are most populous such as California, Texas, New York and Florida have a higher volume of complaints indicating those states also have a higher proportion of account holders.

Also, states that have a relatively high foreclosure rate, tend to have higher mortgage related responses being disputed. Last but not the least, states that have a higher percentage of senior citizens typically tend to have a higher number of cases being disputed.

State complaint volume

The R code used for rendering the map on the server is shown below. All the plots and maps were created using googleVis package in R.

### Code for Insight: Map tab
# Displaying data of interest
choiceResponseMap <- reactive({
capitalize(input$responseMapRB)
})
output$txtMap <- renderText({
if (choiceResponseMap() == "Volume of Complaints") { "Volume of Complaints" }
if (choiceResponseMap() == "% Disputed Responses") { "Percentage of Disputed Responses" }
if (choiceResponseMap() == "% Delayed Responses") { "Percentage of Delayed Responses" }
print (choiceResponseMap())
})
graphInputMap <- reactive({
# Choosing information based on widget inputs
if (input$responseMapRB == "% Disputed Responses") { graphdatMap <- consumer_disp_map_merged }
if (input$responseMapRB == "% Delayed Responses") { graphdatMap <- consumer_compl_map_merged_sla }
if (input$responseMapRB == "Volume of Complaints") { graphdatMap <- consumer_disp_map_merged }
graphdatMap <- graphdatMap %>% filter(Product == input$prodMapSI & Year == input$yearMapSI)
if (input$responseMapRB == "% Disputed Responses") {
graphdatMap <- graphdatMap[,c(3,8)] } # dispute ratio
if (input$responseMapRB == "Volume of Complaints") {
graphdatMap <- graphdatMap[,c(3,4)]} # Volume of Complaints
if (input$responseMapRB == "% Delayed Responses") {
graphdatMap <- graphdatMap[,c(3,7)]} # Late Responses
names(graphdatMap) = c("State","Metric")
data.frame(graphdatMap)
})
# Graphing data of interest
output$plotMap <- renderGvis({
print (graphInputMap())
gvisGeoChart(
graphInputMap(), locationvar="State", colorvar="Metric" ,options=list(
##graphInputMap() ,options=list(
region="US", displayMode="regions",
resolution="provinces",
width=900, height=650, colorAxis="{colors:['#deebf7', '#3182bd']}" ))
})
view raw map_visuals hosted with โค by GitHub

Data

Conclusion

This analysis helps uncover several insights about the typical issues faced by the consumers and the overall trends in the responses provided by financial institutions.

  • The banks and lending companies seem to be handling the complaints in a timely manner since the average % of delayed responses is less than 3%.
  • Mortgage and Debt Collection related complaints account for almost 50% of the total volume of complaints filed. The banks can bring down the number of complaints significantly by focusing on the above products. There seems to be some scope for improvement in terms of enhancing the processes and streamlining the procedures that could help alleviate the mortgage / debt collection related issues.
  • All financial institutions could improve on their communication in addressing the complaints filed by senior citizens. It appears that senior citizens tend to dispute the responses more than other segments of the population which could be due to the difficulty in interpreting bank's response.
  • The banks and other consumer facing financial service providers could do a better job in managing the consumer's expectations. People tend to dispute more when their issues are resolved without any monetary relief and this is where the banks can do a better job in setting and managing expectations so that both parties are on the same page right from the time a complaint is filed.

Once the above factors are addressed, it will help reduce the complaints significantly and make the financial markets a better place for the consumers.

 

About Author

Nanda Rajarathinam

Nanda has been applying his analytical, problem-solving and team management skills, at a leading consulting firm, focusing on data engineering, solution architecture and analytics. He has a strong background in Build, implementation and performance optimization of Extract, Transform...
View all posts by Nanda Rajarathinam >

Leave a Comment

Cancel reply

You must be logged in to post 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