mathewlee11 / lmfm

Factorization Machine in Python, trained using Alternating Least Squares
MIT License
3 stars 2 forks source link

will it work for third order categorical features interaction #1

Open Sandy4321 opened 3 years ago

Sandy4321 commented 3 years ago

Great code, thanks !

Plese help to understand 1 will it work for third order categorical features interaction ? 2 will it run on Windows computer ?

3 will it work for sparse data ?

mathewlee11 commented 3 years ago

@Sandy4321 I haven't touched this project in 5 years so I have no idea if it still works but

  1. No, this only implements two-way feature interactions. The main paper for this https://www.csie.ntu.edu.tw/~b97053/paper/Rendle2010FM.pdf has an optimization that only works for two-way interactions, an algorithm for higher order features would be a lot more slow and complicated. I don't know if other implementations implement it
  2. As long as you can get cython working on windows it should work, but I don't think I've tried
  3. Yes, this algorithm was specifically designed to work well on sparse data. This works with CSR and CSC matrices https://github.com/mathewlee11/lmfm/blob/master/lmfm/lmfm.py#L217