|
| 1 | +ALS(External algorithm library) |
| 2 | +=========== |
| 3 | + |
| 4 | +Introduction |
| 5 | +--------------------- |
| 6 | + |
| 7 | +`[ALS (implicit)] <https://benfred.github.io/implicit/api/models/cpu/als.html>`_ |
| 8 | + |
| 9 | +**ALS (AlternatingLeastSquares)** by implicit is a Recommendation Model based on the algorithm proposed by Koren in `Collaborative Filtering for Implicit Feedback Datasets <http://yifanhu.net/PUB/cf.pdf>`_. |
| 10 | +It furthermore leverages the finding out of `Applications of the Conjugate Gradient Method for Implicit Feedback Collaborative Filtering <https://dl.acm.org/doi/pdf/10.1145/2043932.2043987>`_ for performance optimization. |
| 11 | +`Implicit <https://benfred.github.io/implicit/index.html>`_ provides several models for implicit feedback recommendations. |
| 12 | + |
| 13 | +`[paper] <http://yifanhu.net/PUB/cf.pdf>`_ |
| 14 | + |
| 15 | +**Title:** Collaborative Filtering for Implicit Feedback Datasets |
| 16 | + |
| 17 | +**Authors:** Hu, Yifan and Koren, Yehuda and Volinsky, Chris |
| 18 | + |
| 19 | +**Abstract:** A common task of recommender systems is to improve |
| 20 | +customer experience through personalized recommendations based on prior implicit feedback. These systems passively track different sorts of user behavior, such as purchase history, watching habits and browsing activity, in order to model user preferences. Unlike the much more extensively researched explicit feedback, we do not have any |
| 21 | +direct input from the users regarding their preferences. In |
| 22 | +particular, we lack substantial evidence on which products |
| 23 | +consumer dislike. In this work we identify unique properties of implicit feedback datasets. We propose treating the |
| 24 | +data as indication of positive and negative preference associated with vastly varying confidence levels. This leads to a |
| 25 | +factor model which is especially tailored for implicit feedback recommenders. We also suggest a scalable optimization procedure, which scales linearly with the data size. The |
| 26 | +algorithm is used successfully within a recommender system |
| 27 | +for television shows. It compares favorably with well tuned |
| 28 | +implementations of other known methods. In addition, we |
| 29 | +offer a novel way to give explanations to recommendations |
| 30 | +given by this factor model. |
| 31 | + |
| 32 | +Running with RecBole |
| 33 | +------------------------- |
| 34 | + |
| 35 | +**Model Hyper-Parameters:** |
| 36 | + |
| 37 | +- ``embedding_size (int)`` : The number of latent factors to compute. Defaults to ``64``. |
| 38 | +- ``regularization (float)`` : The regularization factor to use. Defaults to ``0.01``. |
| 39 | +- ``alpha (float)`` : The weight to give to positive examples. Defaults to ``1.0``. |
| 40 | + |
| 41 | +Please refer to [Implicit Python package](https://benfred.github.io/implicit/index.html) for more details. |
| 42 | + |
| 43 | +**A Running Example:** |
| 44 | + |
| 45 | +Write the following code to a python file, such as `run.py` |
| 46 | + |
| 47 | +.. code:: python |
| 48 | +
|
| 49 | + from recbole.quick_start import run_recbole |
| 50 | +
|
| 51 | + run_recbole(model='ALS', dataset='ml-100k') |
| 52 | +
|
| 53 | +And then: |
| 54 | + |
| 55 | +.. code:: bash |
| 56 | +
|
| 57 | + python run.py |
| 58 | +
|
| 59 | +Tuning Hyper Parameters |
| 60 | +------------------------- |
| 61 | + |
| 62 | +If you want to use ``HyperTuning`` to tune hyper parameters of this model, you can copy the following settings and name it as ``hyper.test``. |
| 63 | + |
| 64 | +.. code:: bash |
| 65 | +
|
| 66 | + regularization choice [0.01, 0.03, 0.05, 0.1] |
| 67 | + embedding_size choice [32, 64, 96, 128, 256] |
| 68 | + alpha choice [0.5, 0.7, 1.0, 1.3, 1.5] |
| 69 | +
|
| 70 | +Note that we just provide these hyper parameter ranges for reference only, and we can not guarantee that they are the optimal range of this model. |
| 71 | + |
| 72 | +Then, with the source code of RecBole (you can download it from GitHub), you can run the ``run_hyper.py`` to tuning: |
| 73 | + |
| 74 | +.. code:: bash |
| 75 | +
|
| 76 | + python run_hyper.py --model=[model_name] --dataset=[dataset_name] --config_files=[config_files_path] --params_file=hyper.test |
| 77 | +
|
| 78 | +For more details about Parameter Tuning, refer to :doc:`../../../user_guide/usage/parameter_tuning`. |
| 79 | + |
| 80 | + |
| 81 | +If you want to change parameters, dataset or evaluation settings, take a look at |
| 82 | + |
| 83 | +- :doc:`../../../user_guide/config_settings` |
| 84 | +- :doc:`../../../user_guide/data_intro` |
| 85 | +- :doc:`../../../user_guide/train_eval_intro` |
| 86 | +- :doc:`../../../user_guide/usage` |
0 commit comments