Factorization machines in python