Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

fastFM: A Library for Factorization Machines

License

NotificationsYou must be signed in to change notification settings

ibayer/fastFM

Repository files navigation

The library fastFM is an academic project. The time and resources spentdeveloping fastFM are therefore justified by the number of citations ofthe software. If you publish scientific articles using fastFM, pleasecite the following article (bibtex entrycitation.bib).

Bayer, I. "fastFM: A Library for Factorization Machines" Journal ofMachine Learning Research 17, pp. 1-5 (2016)

fastFM: A Library for Factorization Machines

imageimageimage

This repository allows you to use Factorization Machines inPython(2.7 & 3.x) with the well knownscikit-learn API. All performancecritical code has been written in C and wrapped with Cython. fastFMprovides stochastic gradient descent (SGD) and coordinate descent (CD)optimization routines as well as Markov Chain Monte Carlo (MCMC) forBayesian inference. The solvers can be used for regression,classification and ranking problems. Detailed usage instructions can befound in theonline documentation andonarXiv.

Supported Operating Systems

fastFM has a continuous integration / testing servers (Travis) forLinux (Ubuntu 14.04 LTS) andOS X Mavericks. Other OSs are notactively supported.

Usage

from fastFM import alsfm = als.FMRegression(n_iter=1000, init_stdev=0.1, rank=2, l2_reg_w=0.1, l2_reg_V=0.5)fm.fit(X_train, y_train)y_pred = fm.predict(X_test)

Tutorials and other information are availablehere. The C code is available assubrepository and provides astand alone command line interface. If you still havequestionsafter reading the documentation please open an issue at GitHub.

TaskSolverLoss
Regressionals, mcmc, sgdSquare Loss
Classificationals, mcmc, sgdProbit(Map), Probit, Sigmoid
RankingsgdBPR

Supported solvers and tasks

Installation

binary install (64bit only)

pip install fastFM

source install

Please make sure, that Python and OS bit version agree, e.g. 32bitPython on 64bit OS won't work.

# Install cblas and python-dev header (Linux only).# - cblas can be installed with libatlas-base-dev or libopenblas-dev (Ubuntu)$ sudo apt-get install python-dev libopenblas-dev# Clone the repo including submodules (or clone + `git submodule update --init --recursive`)$ git clone --recursive https://github.com/ibayer/fastFM.git# Enter the root directory$ cd fastFM# Install Python dependencies (Cython>=0.22, numpy, pandas, scipy, scikit-learn)$ pip install -r ./requirements.txt# Compile the C extension.$ make                      # build with default python version (python)$ PYTHON=python3 make       # build with custom python version (python3)# Install fastFM$ pip install .

Tests

The Python tests (pip install nose) can be run with:nosetests fastFM/fastFM/tests

Please refer to the fastFM-core README for instruction on how to run theC tests atfastFM/fastFM-core/src/tests.

Contribution

  • Star this repository: keeps contributors motivated
  • Open an issue: report bugs or suggest improvements
  • Fix errors in the documentation: small changes matter
  • Contribute code

Contributions are very welcome! Since this project lives on GitHubwe recommend to open a pull request (PR) for code contributions as earlyas possible. This is the fastest way to get feedback and allowsTravisCI to run checks on your changes.

Most information you need to setup yourdevelopment environment canbe learned by adapting the great instructions onhttps://github.com/scikit-learn/scikit-learn/blob/master/CONTRIBUTING.md. Please ensure that your contribution conforms to thePEP8 Coding Style andincludes unit tests where appropriate. More valuable guidelines thatapply to fastFM can be found athttp://scikit-learn.org/stable/developers/contributing.html#coding-guidelines.

Contributors

License: BSD


[8]ページ先頭

©2009-2025 Movatter.jp