Build your first gradient tree boosting ML model

The Issue


For nearly 20 years I would download my monthly bank statements and review the transactions every month. I would look at the 'Description' of each transaction, and then assign it to an 'Account', which then feeds into my family finance model.

 

Yes I've been doing this for over 20 years, very meticulously but oh boy did it become ever so tedious! To make this a little bit less mundane I've long ago challenged myself to write excel code so that most of the lines can be automatically assigned an account. To do this I used good-old vlookup tables.



So when the bank statement is imported, Excel would do the vlookup in the master table and then automatically assign. Easy peasy? Well, life is never so simple. There would always be some complication, for starters:

  • Vendors or the bank/credit card company would periodically change their description, so for example ADVANCED HEALTH RECOVE becomes ADVANCED HEALTH RECOVE MARKHAM ON
  • Some vendors bill several amounts each month, with each amount pertaining to a different account
  • Every time I run into a new vendor, I would have to update the master table
  • The Excel formula grew unwieldy, like this:

All in all, it is still very tedious, and at best my accuracy rate for predicting the right account using excel formula was less than 50%. Not nearly good enough for me.

Something had to change.