0

I have a list of orders, which contains a list of items.

I need to use machine learning to suggest other items to customers based purely on their basket at the time of checkout, considering the history of orders placed.

Ideally it must be done with ML.NET.

I have tried a few variations of matrix factorisation but to predict more items for a customer, the starting basket must be in the training set. I can't retrain every time a order is placed, that would take a long time.

Am I going about this the wrong way? Are there different techniques that would work better or have I missed something from matrix factorisation?

Many thanks

Josh Hales
  • 101
  • 2
  • Related: https://learn.microsoft.com/en-us/dotnet/machine-learning/tutorials/movie-recommendation – Memristor Aug 01 '23 at 09:01
  • I had tried that, but unfortunately the predict function input is an existing user with some ratings already, which were contained in the training set. I need to predict with an input which was not in the training set. – Josh Hales Aug 01 '23 at 09:07
  • For predicting something that is not in the training set you need some of the features of it to be in the training set, e.g. a content recommender system. Check my answer to this post. – Memristor Aug 01 '23 at 09:11

1 Answers1

0

Let's say a user have a past basket such item1, item2, item3. Your train set should have the following (X, Y) subsets, being Y a predicted subset:

  • X=(item1), Y=(item2, item3)
  • X=(item2), Y=(item1, item3)
  • X=(item3), Y=(item1, item2)
  • X=(item1, item2), Y=(item3)
  • X=(item2, item3), Y=(item1)
  • X=(item1, item3), Y=(item2)

have you done this? With this technique you should not need to retrain that many often. Also for recommender systems it is always better to have at least a content recommender and a "popular/frequent" recommender, than make an hybrid one with the two previous.

Memristor
  • 236
  • 1
  • 7
  • Not really what I'm looking for. I need to train on a set of data then consume the model in the future. I'm sure I'll retrain in the future but it can't really be a regular thing. – Josh Hales Aug 01 '23 at 10:09
  • Sorry @JayHales but your comment has nothing to do with my answer. You can retrain a model done as I propose, splitting data as I suggest has nothing to do with the ability of retraining it on the future. – Memristor Aug 01 '23 at 13:18
  • Okay, I think I understand your point now. But I don't think ML.NET supports using arrays for input data in this way? – Josh Hales Aug 01 '23 at 14:33
  • Sadly @JayHales I can't help you on this because I never used ML.net. – Memristor Aug 01 '23 at 15:12
  • What library could this be implemented in? – Josh Hales Aug 01 '23 at 15:17
  • @JayHales https://towardsdatascience.com/top-3-python-package-to-learn-the-recommendation-system-bb11a916b8ff – Memristor Aug 02 '23 at 01:20