Installation#

From pypi :

$ pip install -U LibRecommender

Build from source:

$ pip install git+https://github.com/massquantity/LibRecommender.git

Or if you want to modify some source code, e.g. implementing a new algorithm by inheriting from base classes in the library, you can also use editable installs, which allows you to modify the source code and have the changes take effect without having to rebuild and reinstall (The -vv flag is used for outputting the build process)

$ git clone https://github.com/massquantity/LibRecommender.git
$ cd LibRecommender
$ pip install -e . -vv

Dependencies#

Hint

LibRecommender contains two modules: libreco for training and libserving for serving. If one only wants to train a model, dependencies for libserving are not needed.

Caution

Since version 1.0.0, the following dependencies will NOT be installed along with LibRecommender to avoid messing up your local dependencies.

Please make sure dependencies in your machine meet the version requirements. Or one can manually run the requirements file:

$ pip install -r requirements.txt

to install all the libreco dependencies.

Dependencies for libreco:#

  • Python >= 3.6

  • TensorFlow >= 1.15, < 2.16

  • PyTorch >= 1.10

  • Numpy >= 1.19.5

  • Pandas >= 1.0.0

  • Scipy >= 1.2.1, < 1.13.0

  • scikit-learn >= 0.20.0

  • gensim >= 4.0.0

  • tqdm

  • nmslib (optional, see Embedding)

  • DGL (optional, see Implementation Details)

  • Cython >= 0.29.0, < 3 (optional, for building from source)

Note

If you are using Python 3.6, you also need to install dataclasses, which was first introduced in Python 3.7.

Known issue: Sometimes one may encounter errors like ValueError: numpy.ndarray size changed, may indicate binary incompatibility. Expected 88 from C header, got 80 from PyObject. In this case try upgrading numpy, and version 1.22.0 or higher is probably a safe option.

Dependencies for libserving:#