Skip to content

💰 Using Machine Learning and Brain JS, discover your loan affordability by getting your FREE Risk Score!

Notifications You must be signed in to change notification settings

sts-ryan-holton/loan-risk-score

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

💰 Loan Affordability (Risk Score)

This project uses machine learning neural networks using Brain JS to calculate an applicant's likelihood of being able to repay a loan. A Risk Score is provided to the applicant ranging from 0 to 500, the higher the number, the better (more chance of affording the loan)

🌟 Demo

See it in action

🔧 Param options

  • ?enable_seed_data=true - pass this to generate random data to test the system.
  • ?enable_logs=true - pass this to get real-time console updates as Brain JS learns your data.
  • ?enable_risk_factor_logging=true - pass this to see your individual risk factors, logged to the console.
  • ?salary=500 - pass a number as a salary to set salary on page load.

💡 How it works

We use Brain JS

The core concept of this system is to provide a score to the user on their likelihood of being able to repay a loan using machine learning. This works by feeding the machine learning system a set of "training data" in a JSON format, providing an input, and an output as to whether the input is good or bad, the system can then figure out a probability between 0-100 (100 being very likely to be able to afford a loan)

📚 Training Data

Training data collected from hundreds of jobs via Node JS scraping using Cheerio and Puppeteer (development use only)

Using the below assumptions, if a take-home pay is provided lower than £1,500 a month, and doesn't look accurate, a lower probability will occur.

Salary

  1. If min & max salary provided, they're added together and divided to get a yearly average.
  2. If single salary provided, no extra assumptions made.
  3. If hourly salary provided, we randomly pick either 37 or 25 hrs a week, and 4.3 weeks a month, calculated over a year.
  4. All salaries are then divided by 12 to get a monthly salary.
  5. All salaries have approx 17% deducted as a buffer for tax and NI.

Expenses

  1. £190/month, Utility Bills (Gas, Electric, Water, Phone, TV, Broadband), source
  2. £600/month, Rent/Mortgage (1 bedroom), source
  3. £260/month, Food shopping (small family), source

Loan

  1. A loan average of £500 taken based on approx 6,000 applicants.

🔍 Scraper

Install the scraper, you need Node JS 10 or greater

# clone project
$ git clone [email protected]:sts-ryan-holton/loan-risk-score.git

# install dependencies.
$ npm install

⚠️ You will need to enable the scraper, and provide a URL to scrape. We've provided an example that you can copy.

🔧 Starting

# start scraping
$ node scraper/scrape-jobs.js

🔧 Starting - With options

# start scraping with options (you can pass all, or some of the following with number format)
$ node scraper/scrape-jobs.js --searchRadius=300 --memThreshold=50 --tempThreshold=93 --scrapeInterval=1000 --thresholdDelay=7500

About

💰 Using Machine Learning and Brain JS, discover your loan affordability by getting your FREE Risk Score!

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published