I have two data sets with transaction history of customers by date and product (de-identified). These are from two different sources and have different capture rate (e.g.: One might have 5 transactions for a customer and the other may report 7). I also have information like ZIP, age, gender for these customers.

What machine learning algorithm can I leverage to find same customers across the sources based on similarity in transnational history?

I was thinking if somehow collaborative filtering may be of help here.

Thanks in advance!


1 Answer 1


Nearest Neighbours is already a clustering model that automatically will cluster items within a data set.


Another similar algorithm is K-Means, very effective also that requires low computing power.

The key point here I can guess is that you will need to make some research on data normalization and data scaling. Yoy may have to transform your data converting categorical features into binary ones and other stuff.

The first step is deciding which algorithm you will use and the second one is being aware of what type of data it expects.

  • $\begingroup$ Thanks for your response Ginzalo. KNN is definitely one way of doing it, but will it also consider the date stamps of these transactions and the sequence of transactions into consideration? I have sequence of events for each customer in the table. I need to match the customer based on similarity of event occurrence in a sequence $\endgroup$ Commented May 24, 2017 at 12:03
  • $\begingroup$ Collaborative filtering won't capture the sequential aspect. You could look into time series modeling. $\endgroup$
    – Antimony
    Commented May 25, 2017 at 0:47
  • $\begingroup$ You may need to use the timestamps for joining the two tables, but you should not use timestamps within your statistical models. Instead of that create derived items such as days differences, differences in weeks, day of the week (using binomial columns), holiday days, working days, quarter (again using binomial columns), etc... $\endgroup$ Commented May 25, 2017 at 13:37
  • $\begingroup$ I forgot to mention, if you want some non-linear classification tool you may also check Random Forest and Support Vector Machines as they can be used for classification. Neural networks are also good for that purpose but they're much more complex to configure and the results not necessarily would be better. $\endgroup$ Commented May 25, 2017 at 13:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.