Skip to main content

A Theano-based Python implementation of Factorization Machines

Project description


A Theano-based Python implementation of factorization machines, based on the model presented in Factorization Machines (Rendle 2010).


  • Sample weighting
  • For binary classification, this implementation uses a logit function combined with a cross entropy loss function.
  • Extensibility of algorithms for: regularization, loss function optimization, and the error function
  • Support for sparse data


pyfms supports Python 2.7 and Python 3.x.

Linux and Mac are supported.

Windows is supported with Theano properly installed. The recommended way to install Theano on Windows is using Anaconda.

> conda install theano

Other operating systems may be compatible if Theano can be properly installed.


pyfms is available on PyPI, the Python Package Index.

$ pip install pyfms



Example Usage


scikit-learn>=0.18 is required to run the example code.


Tests are in tests/.

# Run tests
$ python -m unittest discover tests -v


pyfms has an MIT License.



RMSprop code is from Newmu/Theano-Tutorials.

Adam code is from Newmu/dcgan_code.


Rendle, S. 2010. “Factorization Machines.” In 2010 IEEE 10th International Conference on Data Mining (ICDM), 995–1000. doi:10.1109/ICDM.2010.127.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for pyfms, version 0.4.0
Filename, size File type Python version Upload date Hashes
Filename, size pyfms-0.4.0-py2.py3-none-any.whl (8.4 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size pyfms-0.4.0.tar.gz (10.1 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page