I am working on a market basket analysis. I have a data set with a number of purchases the last year. So, I have baskets of products along with the purchased date. I need to calculate a weight for each product based on the dates that it was bought. The most recently a product was being bought, the larger weight it will have.
For example:
**Basket** **Days before today**
{A,B,C,D} 350
{A,B,E,F} 320
{A,B,G,H,I} 300
{E,F,B,K} 25
{A,E,J,K} 10
{E,F} 5
In the above example, products A and B should have a lower weight than the products E and F. As products E and F were frequently bought recently. What would be a mathematical approach to calculate those weights.