0 votes
1 view
in Machine Learning by (16.1k points)

I am developing an e-shop where I will sell food. I want to have a suggestion box where I would suggest what else my user could buy based on what he's already had in cart. If he has a beer, I want him to suggest chips and other things by descending the precentage of probability that he'll buy it too. But I want that my algorithm would learn to suggest groceries based on all users' previous purchases. Where should I start? I have groceries table user_id, item_id, date and similar. How can I make a suggestion box without brute-forcing which is impossible?

1 Answer

0 votes
by (33.2k points)

It looks like you want to build a recommendation engine, more specifically collaborative filtering. It is an example of how Amazon recommends products to users based on previous orders and Netflix recommends movies based on recent search history.

If I’d be more specific, You don't:

  • want to recommend items that are already in the basket.

  • want to recommend cheaper versions of the things that are already in the basket.

  • want to recommend items that are out of stock.

  • want to recommend items that are statistically valid, but make no sense

The above mentioned are cases that you can also build using machine learning, But your problem is different from them as I can understand. You want to recommend items that are in promotion right now.

I think these are the options for you:

  • manually maintain the related products. Time-consuming, but clear way.

  • use either SaaS or include a library like R which supports this.

  • recommend (semi)random products. Have a set of products you want to recommend, and pick one at random - for instance, products on promotion, products which are in the "best seller" list, products which cost less than x. Exclude categories that could be problematic.

All those options are achievable in a reasonable time; the problem with building a proper solution from scratch is that everyone will measure it against Amazon, and they've got a bit of a head start on you.

If you want to know about What is R Programming then visit this R Programming Course.

Welcome to Intellipaat Community. Get your technical queries answered by top developers !