Monday, October 12, 2015

Faster BTYD

The R-library "Buy 'Til You Die" for customer equity forecasting looked promising, but I quickly realised that the implementation relies heavily on loops and is not suited for any data set bigger than a couple of thousand rows.

To speed things up, I switched out a couple of the loops for some data.table magic. Here it is, about 10000X faster than the original, but there is still some room for improvement.

If you're having trouble getting the BTYD package to run, take a look at this post for fixes.

No comments:

Entertaining Blogs - BlogCatalog Blog Directory
Bloggtoppen.se