Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have the old setup.ipnyb - need the new one plz! #7

Open
wants to merge 65 commits into
base: akh_pg
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
65 commits
Select commit Hold shift + click to select a range
d062e07
1/30
tws223 Jan 31, 2023
e6a4829
HMDA set up + mini hmda :)
tws223 Feb 1, 2023
dee1962
Create readme.md
donbowen Feb 1, 2023
ae44f3a
Update Setup.ipynb
donbowen Feb 1, 2023
52b2d7e
Merge pull request #2 from LeDataSciFi/tws_branch
donbowen Feb 1, 2023
dda4b23
Delete .DS_Store
donbowen Feb 1, 2023
a2841b4
Delete Setup.ipynb
donbowen Feb 1, 2023
7fddb92
Create Test.Txt
donbowen Feb 1, 2023
535a1d1
Delete Test.Txt
donbowen Feb 1, 2023
fcaa607
infastructure in place, time to fill in
donbowen Feb 6, 2023
b5318af
Merge pull request #8 from LeDataSciFi/infrastructure_not_ready
donbowen Feb 6, 2023
7088208
Still need to finish prep for all files.
donbowen Feb 9, 2023
993fdd2
Update Analysis_aggregate_comps.ipynb
donbowen Feb 9, 2023
989aa62
Day 7
donbowen Feb 13, 2023
13cd748
ready for thomas :)
donbowen Feb 15, 2023
464c8a4
Create WIP_AZ_White_Minority_Map.ipynb
donbowen Feb 15, 2023
13a9289
Update bank_tract_clean_WITH_CENSUS.csv
donbowen Feb 20, 2023
ce66685
maps function
donbowen Feb 20, 2023
bd40d6f
Update Redlined_AZ_Maps.ipynb
donbowen Feb 21, 2023
ed9d0d1
We need to get plot to work...
donbowen Feb 22, 2023
a6aacb0
Working maps! (Some issues)
donbowen Feb 22, 2023
dc16336
data updated
donbowen Feb 22, 2023
52d6158
Update Redlined_AZ_Maps.ipynb
donbowen Feb 22, 2023
a7b3920
Whew boy, lotsa viz
donbowen Feb 23, 2023
6edb52f
Create gpt_api.txt
donbowen Mar 30, 2023
7a22366
Delete gpt_api.txt
donbowen Mar 30, 2023
6905b4a
Update .gitignore
donbowen Mar 30, 2023
ff3b1dc
gptloan officer
donbowen Mar 30, 2023
98a4a2b
Synthesizing months of work
donbowen Apr 5, 2023
1c7a5bf
refactor gpt code
donbowen Apr 5, 2023
efbafc5
committing changed files
jum223 Apr 9, 2023
9131052
finalChangedFiles
jum223 Apr 9, 2023
79698f3
Merge pull request #16 from LeDataSciFi/changedFiles
donbowen Apr 10, 2023
7749343
test
jum223 Apr 10, 2023
28a47ba
Descriptive stats change
jum223 Apr 10, 2023
6073515
Regression changes
jum223 Apr 11, 2023
c99313c
updates to regression
jum223 Apr 11, 2023
c9d225f
moreChanges
jum223 Apr 11, 2023
c6ef802
4regressionTables
jum223 Apr 11, 2023
3d2cdc9
test
jum223 Apr 12, 2023
9b7a89f
txtTables
jum223 Apr 12, 2023
51655e2
finalReg
jum223 Apr 12, 2023
de7bd4b
Merge pull request #19 from LeDataSciFi/changedFiles
donbowen Apr 12, 2023
ace253d
Delete .DS_Store
donbowen Apr 19, 2023
940caa5
Delete .DS_Store
donbowen Apr 19, 2023
f9779bd
plots merged
donbowen Apr 19, 2023
0fc814b
Update README.md
donbowen Apr 20, 2023
527d606
Update README.md
donbowen May 9, 2023
0e30e53
Update README.md
donbowen May 9, 2023
fe7e9b9
Update README.md
donbowen May 9, 2023
f15f1dd
Update README.md
donbowen May 9, 2023
0b002b0
Create _config.yml
donbowen May 9, 2023
c24caf9
Create base.html
donbowen May 9, 2023
5ab50f1
Create home.html
donbowen May 9, 2023
cdc2160
Create home.html
donbowen May 9, 2023
85dbafa
delete extra home
donbowen May 9, 2023
f9a52f4
Update _config.yml
donbowen May 9, 2023
253bc4f
Create Gemfile
donbowen May 9, 2023
35279fe
Update _config.yml
donbowen May 9, 2023
59a6d5a
Update _config.yml
donbowen May 9, 2023
b14c01e
Update Gemfile
donbowen May 9, 2023
de2f947
Update Gemfile
donbowen May 9, 2023
7414a0d
Update README.md
donbowen May 9, 2023
ca66ffa
Update README.md
donbowen May 9, 2023
d6c1c79
Update README.md
donbowen May 9, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
gpt_api.txt
.DS_Store
**state_AZ-CA_clean.csv

# huge data files
state_AZ-CA.csv
census_token.txt
state_AZ-CA_clean

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand Down Expand Up @@ -127,3 +136,6 @@ dmypy.json

# Pyre type checker
.pyre/

# State_az-ca
.state_AZ-CA.gitignore
13 changes: 13 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
source "https://rubygems.org"

gem "jekyll", "~> 4.3.1"
gem "minima", "~> 2.5"

# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
# uncomment the line below. To upgrade, run `bundle update github-pages`.
# gem "github-pages", group: :jekyll_plugins
# If you have any plugins, put them here!
group :jekyll_plugins do
gem 'jekyll-seo-tag'
gem "jekyll-feed"
end
52 changes: 49 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,51 @@
# Welcome everyone!
# Analyzing Bank of the West Lending Practices

This will be a heavily evolving repository as we figure out how we want to organize the team and projects.
_**Lehigh FinTech Capstone 2023**_

[Word docs and notes are in the google drive.](https://drive.google.com/drive/u/0/folders/1DPcRaSeDLkYzMvdZ4mGRYJXpyK3mLcln)
## Key outputs

1. [The final report is here](https://docs.google.com/document/d/10il6w9Ba1WiDdkzaO7gURanng8vfJzrE1dgXDekf2hc/edit), and we've copied the [executive summary](#executive-summary) below
1. [Presentation slides are here](https://docs.google.com/presentation/d/1jt--nWi-Bth0zlxHGE6x_nIYyhP1IL9sWMuiedoogvk/)
1. Interactive maps to see how BOW's lending behavior is related to demographics. In these figures, red dots are "majority-minority" Census tracts (i.e. the white population is under 50%) and the shading of a tract corresponds to various lending statistics within that tract.
- [BOW's loan volume](images/BOW_log(numloans).html)
- [Denial rate of BOW minus denial rate of other banks](images/denial_rate_percent_difference.html)
- [BOW's denial rate](images/BOW_denial_rate.html)
- [BOW's loan dollar volume](images/BOW_log(dol_loans).html)
- [BOW's rate spread](images/BOW_mean_approved_rate_spread.html)

## Project structure

- [The final report, slides, and many other resources are in the google drive.](https://drive.google.com/drive/u/0/folders/1DPcRaSeDLkYzMvdZ4mGRYJXpyK3mLcln)
- [Code for the project is in a GitHub repo](https://github.com/LeDataSciFi/FinTech-Capstone-2023)
- `input_data/` contains raw files except for the full HMDA data
- `input_data_cleaned/` contains files ready for analysis
- **`images/` contains interactive HTML plots to facilitate visual analysis of how BOW's lending behavior is related to demographics in space**
- `code/` contains
1. `Setup` downloads the necessary files. There is one manual step.
1. `Prep_datasets` cleans the raw inputs and reshapes and merges them for use.
1. Various analysis files independently create various outputs.
- `my_gpt_loan_officer/` contains an experiment assessing bias in GPT responses to loan applications

## Executive summary

Historically, redlining prevented residents of specific areas from accessing credit due to race or ethnicity. Today, government regulations prevent financial institutions from making lending decisions based on an applicant's demographic attributes. As the Bank of Montreal (BMO), the sponsor financial institution of the Spring 2023 Lehigh Fintech Capstone class, completed its acquisition of Bank of the West in February 2023, this paper conducts a comprehensive examination of the lending behaviors of Bank of the West and reports our findings to personnel at the Bank of Montreal.

Specifically, this paper analyzes the lending behaviors of Bank of the West (BOW) in Arizona and California using the Home Mortgage Disclosure Act (HMDA) loan-level data and Census tract demographic information for 2021. The analysis aims to help BMO Harris (which recently acquired Bank of the West) understand if BOW's lending falls short of BMO Harris's goal to serve underserved communities and steps BMO Harris can take to address any shortcomings. The analysis uses maps, regression models, and an experiment with OpenAI's ChatGPT API to assess the impact of demographic information on loan decisions.

- In areas with high Black populations, BOW is less likely to receive any mortgage applications and fewer applications but has a lower denial rate than similar-sized banks.

- In areas with high Hispanic populations, BOW is less likely to receive any mortgage applications but receives more applications and has a lower denial rate than similar-sized banks.

- In areas with high Asian populations, BOW is more likely to receive mortgage applications and receives more applications but has a higher denial rate than similar-sized banks.

- ChatGPT makes lending decisions consistent with real loan outcomes, but adding demographic information changes the loan approval rates. Bias can be reduced by explicitly asking it to decide without prejudice.

- By segmenting the data by major minority groups, we can identify differences in loan practices towards different minority groups and understand the factors contributing to these differences. For example, the higher loan approval rates for Black and Hispanic/Latino groups at Bank of the West may be due to specific outreach programs or underwriting practices designed to support these groups.

- For San Francisco, BOW generally has a lower denial rate for majority-minority tracts than competitors. In Los Angeles, BOW does not receive loan applications in most majority-minority tracts.

## The team

![image](https://github.com/LeDataSciFi/FinTech-Capstone-2023/assets/50885867/bebcf589-3afb-4577-8b1f-4dff0ab8c11e)

_ELLIE DEGEORGES, VICTORIA GENCO, ISAAC GRODIN, ANNA HARVEY, JUAN MOZOS NIETO, MATTHEW ROMANO, SEBASTIAN STONEHAM, THOMAS SCARINGELLA, XIAOZHE ZHANG_
84 changes: 0 additions & 84 deletions Setup.ipynb

This file was deleted.

14 changes: 14 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# From: https://github.com/jekyll/minima/issues/717#issuecomment-1460912086

# Disable using the latest Minima release
#theme: minima
# And instead pull straight from GitHub via jekyll remote theme
remote_theme: jekyll/minima

plugins:
- jekyll-seo-tag
- jekyll-feed
- jekyll-remote-theme

minima:
skin: solarized-light
16 changes: 16 additions & 0 deletions _layouts/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<html lang="{{ page.lang | default: site.lang | default: "en" }}">

{%- include head.html -%}

<body>

<main class="page-content" aria-label="Content">
<div class="wrapper">
{{ content }}
</div>
</main>

</body>

</html>
9 changes: 9 additions & 0 deletions _layouts/home.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---
layout: base
---

<div class="home">

{{ content }}

</div>
Loading