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)
?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 anumber
as a salary to set salary on page load.
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 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.
- If min & max salary provided, they're added together and divided to get a yearly average.
- If single salary provided, no extra assumptions made.
- If hourly salary provided, we randomly pick either 37 or 25 hrs a week, and 4.3 weeks a month, calculated over a year.
- All salaries are then divided by 12 to get a monthly salary.
- All salaries have approx 17% deducted as a buffer for tax and NI.
- £190/month, Utility Bills (Gas, Electric, Water, Phone, TV, Broadband), source
- £600/month, Rent/Mortgage (1 bedroom), source
- £260/month, Food shopping (small family), source
- A loan average of £500 taken based on approx 6,000 applicants.
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
# start scraping
$ node scraper/scrape-jobs.js
# 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