Skip to content

Colaborative Filtering based on latent factors, implicit feedback, neighbourhood, and SLIM.

License

Notifications You must be signed in to change notification settings

rmwkwok/colabfilter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Colaborative Filtering


Contributors Forks Stargazers Issues MIT License LinkedIn


About the project

A demo of collaborative filtering based on -

1. Latent factors
2. Implicit feedback
3. Neighbourhood
4. SLIM algorithm

Data

Overall workflow

To be capable of processing data with large numbers of users and items, the source data is read and processed in chunks, and both the source and target data are stored in PyTables format:

Data relations

To create the final set of TFRecords for model training, some intermediate arrays are derived, which include, namely, "interaction", "correlation", and "neighbours":

For more explanation about the three arrays, refer to the Jupyter Notebook in ./demo.

Model

A TensorFlow model was created with the three individual on-off options available:

For more details, refer to the Jupyter Notebook in ./demo.

Some training curves

The small MovieLens dataset "ml-latest-small" with ~100,000 ratings is used for this demo.

For details about the searched parameters, refer to the Jupyter Notebook in ./demo.

Tested environment

python

Download and use

  1. Clone this repository
git clone https://github.com/rmwkwok/colabfilter.git
cd colabfilter
  1. (Recommended) Setup and activate virtual environment
virtualenv venv
source venv/bin/activate
  1. Install requirements
pip install -r requirements.txt
  1. (Recommended) Add kernel for the created virtual environment to be usable in Jupyter
python -m ipykernel install --user --name=colabfilter-venv
  1. Build cython programs (correlations and neighbours are computed by Cython programs)
python setup.py build_ext --inplace
  1. Open the Jupyter Notebook in ./demo with Jupyter-lab or Jupyter-notebook

Uninstall

  1. Verify that the kernel (named "colabfilter-venv") added in the step 4 is there
jupyter kernelspec list
  1. Uninstall the kernel
jupyter kernelspec uninstall colabfilter-venv
  1. Deactivate the virtual environment
deactivate
  1. Delete the folder containing the virtual environment, and delete the cloned repository.

About

Colaborative Filtering based on latent factors, implicit feedback, neighbourhood, and SLIM.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published