0

I have data in the given form:

Date       | Products
2014-01-01 | A,B,C,D
2014-01-02 | M,N
2014-01-03 | B,X
2014-01-06 | M
2014-02-07 | F,B
2014-02-09 | M,A

I want to use some algorithm to identify that M is mostly bought after B, i.e. B and M have some association. Has anyone here ever solved some problem of this sort?

g_yogini
  • 43
  • 7

1 Answers1

0
  1. make them in one list

like [A,B,C,D,M,N,B,X,M,F,B,M,A]

  1. make it weighted.

The first char behind M weights 1, the second one weights 2, till the next M.

  1. sum them up.

the char with lightest weight wins. (which means has some association in your word.)

flycee
  • 11,948
  • 3
  • 19
  • 14