{"id":13423719,"url":"https://github.com/gasevi/pyreclab","last_synced_at":"2025-03-15T17:32:12.839Z","repository":{"id":62583012,"uuid":"81293125","full_name":"gasevi/pyreclab","owner":"gasevi","description":"pyRecLab is a library for quickly testing and prototyping of traditional recommender system methods, such as User KNN, Item KNN and FunkSVD Collaborative Filtering. It is developed and maintained by Gabriel Sepúlveda and Vicente Domínguez, advised by Prof. Denis Parra, all of them in Computer Science Department at PUC Chile, IA Lab and SocVis Lab.","archived":false,"fork":false,"pushed_at":"2020-09-04T08:16:13.000Z","size":1884,"stargazers_count":122,"open_issues_count":3,"forks_count":28,"subscribers_count":15,"default_branch":"master","last_synced_at":"2025-02-18T07:16:37.730Z","etag":null,"topics":["alternating-least-squares","implicit-feedback","knn","rating","rating-prediction","recommendation-algorithm","svd"],"latest_commit_sha":null,"homepage":"","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gasevi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-08T05:54:46.000Z","updated_at":"2024-08-20T01:01:56.000Z","dependencies_parsed_at":"2022-11-03T21:34:34.231Z","dependency_job_id":null,"html_url":"https://github.com/gasevi/pyreclab","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gasevi%2Fpyreclab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gasevi%2Fpyreclab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gasevi%2Fpyreclab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gasevi%2Fpyreclab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gasevi","download_url":"https://codeload.github.com/gasevi/pyreclab/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243767199,"owners_count":20344889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alternating-least-squares","implicit-feedback","knn","rating","rating-prediction","recommendation-algorithm","svd"],"created_at":"2024-07-31T00:00:41.195Z","updated_at":"2025-03-15T17:32:11.876Z","avatar_url":"https://github.com/gasevi.png","language":"C++","funding_links":[],"categories":["C++"],"sub_categories":[],"readme":"# \u003ccenter\u003e \u003cspan style=\"color:#00f; font-size: 4em;\"\u003e*pyRecLab*: Recommendation lab for Python\u003c/span\u003e \u003c/center\u003e\n\n## \u003cspan style=\"font-size: 4em;\"\u003eOverview\u003c/span\u003e\n\n   *pyRecLab* is a recommendation library designed for training recommendation models with a friendly and easy-to-use interface, keeping a good performance in memory and CPU usage.\n\n   In order to achieve this, *pyRecLab* is built as a Python module to give a friendly access to its algorithms and it is completely developed in C++ to avoid the lack of performace of the interpreted languages.\n\n   At this moment, the following recommendation algorithms are supported:\n\n\u003c!-- Tick      : \u0026#10003 --\u003e\n\u003c!-- Bold tick : \u0026#10004 --\u003e\n\n| RecSys Algorithm             | Rating Prediction | Item Recommendation | Implicit Feedback |\n|:-----------------------------|:-----------------:|:-------------------:|:-----------------:|\n| User Average                 | x                 | x                   |                   |\n| Item Average                 | x                 | x                   |                   |\n| Slope One                    | x                 | x                   |                   |\n| User Based KNN               | x                 | x                   |                   |\n| Item Based KNN               | x                 | x                   |                   |\n| Funk's SVD                   | x                 | x                   |                   |\n| Most Popular                 |                   | x                   |                   |\n| ALS                          |                   | x                   | x                 |\n| ALS with Conjugate Gradient  |                   | x                   | x                 |\n| BPR for Matrix Factorization |                   | x                   | x                 |\n\n\n\u003c!--\n**Rating Prediction**\n\n  * User Average\n  * Item Average\n  * Slope One\n  * User Based KNN\n  * Item Based KNN\n  * Funk's SVD\n\n**Item Recommendation**\n\n  * Most Popular\n\n**Implicit Feedback**\n\n  * ALS\n  * ALS with Conjugate Gradient method\n--\u003e\n\n   Although *pyRecLab* can be compiled on most popular operating system, it has been tested on the following distributions.\n\n| Operating System | Version              |\n|:-----------------|:---------------------|\n| Ubuntu           | 16.04                |\n| CentOS           | 6.4                  |\n| Mac OS X         | 10.11 ( El Capitan ) |\n| Mac OS X         | 10.12 ( Sierra )     |\n\n\n## \u003cspan style=\"font-size: 4em;\"\u003eCitations\u003c/span\u003e\n\nIf you use this library, please cite:\n\n@inproceedings{1706.06291v2,\n   author        = {Gabriel Sepulveda and Vicente Dominguez and Denis Parra},\n   title         = {pyRecLab: A Software Library for Quick Prototyping of Recommender Systems},\n   year          = {2017},\n   month         = {August},\n   eprint        = {arXiv:1706.06291v2},\n   keywords      = {Recommender Systems, Software Development, Recommender Library, Python Library}\n}\n\n[Check out our paper](https://arxiv.org/pdf/1706.06291v2.pdf)\n\n\n## \u003cspan style=\"font-size: 4em;\"\u003eInstall\u003c/span\u003e\n\n*pyRecLab* can be installed directly using pip as follow:\n\n### Python 2\n\n```sh\npip install pyreclab\n```\n\n### Python 3\n\n```sh\npip3 install pyreclab\n```\n\n\n## \u003cspan style=\"font-size: 4em;\"\u003eBuild and Install\u003c/span\u003e\n\nIn case there is not a package available for your favorite operating system, you can build *pyRecLab* through the following steps:\n\n1.- Before starting, verify you have *libpython-dev*, *boost* and *cmake* installed on your system. If not, install it through your distribution's package manager, as shown next.\n\n### Debian based OS's ( Ubuntu )\n\n```sh\n$ sudo apt-get install libpython-dev\n$ sudo apt-get install cmake\n$ sudo apt-get install libboost-dev\n```\n\nNote: for Python 3.x, install *libpython3-dev* instead of *libpython-dev*.\n\n### RedHat based OS's ( CentOS )\n\n```sh\n$ yum install python-devel\n$ yum install cmake\n$ yum install boost-devel\n```\n\n### MAC OS X\n\n```sh\n$ brew install cmake\n$ brew install boost\n```\n\n2.- Clone the source code of *pyRecLab* in a local directory.\n\n```sh\n$ git clone https://github.com/gasevi/pyreclab.git\n```\n\n3.- Build the Python module ( default: *Python 2.7* ).\n\n```sh\n$ cd pyreclab\n$ cmake .\n$ make\n```\n\nBy default, pyRecLab will be compiled for *Python 2.7*. If you want to build it for *Python 3.x*, you can execute the following steps:\n\n```sh\n$ cd pyreclab\n$ cmake -DCMAKE_PYTHON_VERSION=3.x .\n$ make\n```\n\n4.- Install pyRecLab.\n\n```sh\n$ sudo make install\n```\n\n\n## \u003cspan style=\"font-size: 4em;\"\u003eAPI Documentation\u003c/span\u003e\n\n   pyRecLab provides the following classes for representing each of the recommendation algorithm currenly supported:\n\n * [pyreclab.UserAvg](#useravg)\n * [pyreclab.ItemAvg](#itemavg)\n * [pyreclab.SlopeOne](#slopeone)\n * [pyreclab.UserKnn](#userknn)\n * [pyreclab.ItemKnn](#itemknn)\n * [pyreclab.SVD](#svd)\n * [pyreclab.MostPopular](#mostpopular)\n * [pyreclab.IFAls](#ifals)\n * [pyreclab.IFAlsConjugateGradient](#ifalscg)\n * [pyreclab.BprMf](#bprmf)\n\n   So, you can import any of them as follows:\n\n```python\n\u003e\u003e\u003e from pyreclab import \u003cRecAlg\u003e\n```\n\n   or import the entire module as you prefer\n\n```python\n\u003e\u003e\u003e import pyreclab\n```\n\n   Due to the different nature of each algorithm, their implementations can have some variations on its parameters. For this reason, each class is described in detail in the following sections.\n\n\n### \u003ca name=\"useravg\"\u003e pyreclab.UserAvg \u003c/a\u003e\n\n * Instance creation\n\n```python\n\u003e\u003e\u003e obj = pyreclab.UserAvg( dataset = filename,\n                            dlmchar = b'\\t',\n                            header = False,\n                            usercol = 0,\n                            itemcol = 1,\n                            ratingcol = 2 )\n```\n\n| Parameter | Type      | Default value | Description                                                 |\n|:----------|:---------:|:-------------:|:------------------------------------------------------------|\n| dataset   | mandatory | N.A.          | Dataset filename with fields: userid, itemid and rating     |\n| dlmchar   | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header    | optional  | False         | Whether dataset filename contains a header line to skip     |\n| usercol   | optional  | 0             | User column position in dataset file                        |\n| itemcol   | optional  | 1             | Item column position in dataset file                        |\n| ratingcol | optional  | 2             | Rating column position in dataset file                      |\n\n * Training\n\n```python\n\u003e\u003e\u003e obj.train( progress = False )\n```\n\n| Parameter | Type      | Default value | Description       |\n|:----------|:---------:|:-------------:|:------------------|\n| progress  | optional  | False         | Show progress bar |\n\n * Rating prediction\n\n```python\n\u003e\u003e\u003e prediction = obj.predict( userId, itemId )\n```\n\n| Parameter | Type      | Default value | Description       |\n|:----------|:---------:|:-------------:|:------------------|\n| userId    | mandatory | N.A.          | User identifier   |\n| itemId    | mandatory | N.A.          | Item identifier   |\n\n * Top-N item recommendation\n\n```python\n\u003e\u003e\u003e ranking = obj.recommend( userId, topN, includeRated )\n```\n\n| Parameter    | Type      | Default value | Description                               |\n|:-------------|:---------:|:-------------:|:------------------------------------------|\n| userId       | mandatory | N.A.          | User identifier                           |\n| topN         | optional  | 10            | Top N items to recommend                  |\n| includeRated | optional  | False         | Include rated items in ranking generation |\n\n * Testing and evaluation for prediction\n\n```python\n\u003e\u003e\u003e predictionList, mae, rmse = obj.test( input_file = testset,\n                                          dlmchar = b'\\t',\n                                          header = False,\n                                          usercol = 0,\n                                          itemcol = 1,\n                                          ratingcol = 2,\n                                          output_file = 'predictions.csv' )\n```\n\n| Parameter   | Type      | Default value | Description                                                 |\n|:------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file  | mandatory | N.A.          | Testset filename                                            |\n| dlmchar     | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header      | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol     | optional  | 0             | User column position in dataset file                        |\n| itemcol     | optional  | 1             | Item column position in dataset file                        |\n| ratingcol   | optional  | 2             | Rating column position in dataset file                      |\n| output_file | optional  | N.A.          | Output file to write predictions                            |\n\n\n * Testing for recommendation\n\n```python\n\u003e\u003e\u003e recommendationList, map, ndcg = obj.testrec( input_file = testset,\n                                                 dlmchar = b'\\t',\n                                                 header = False,\n                                                 usercol = 0,\n                                                 itemcol = 1,\n                                                 ratingcol = 2,\n                                                 topn = 10,\n                                                 output_file = 'ranking.json',\n                                                 relevance_threshold = 0,\n                                                 includeRated = False )\n```\n\n| Parameter    | Type      | Default value | Description                                                 |\n|:-------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file   | mandatory | N.A.          | Testset filename                                            |\n| dlmchar      | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header       | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol      | optional  | 0             | User column position in dataset file                        |\n| itemcol      | optional  | 1             | Item column position in dataset file                        |\n| ratingcol    | optional  | 2             | Rating column position in dataset file                      |\n| topn         | optional  | 10            | Top N items to recommend                                    |\n| output_file  | optional  | N.A.          | Output file to write predictions                            |\n| relevance_threshold | optional  | 0          | Lower threshold to consider an item as relevant ( threshold value included ) |\n| includeRated | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Precision\n\n```python\n\u003e\u003e\u003e precision = obj.precision( user_id,\n                               retrieved,\n                               topn = 10,\n                               relevance_threshold = 0,\n                               include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Recall\n\n```python\n\u003e\u003e\u003e recall = obj.recall( user_id,\n                         retrieved,\n                         topn = 10,\n                         relevance_threshold = 0,\n                         include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Area Under the ROC Curve (AUC)\n\n```python\n\u003e\u003e\u003e auc = obj.AUC( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Mean Average precision\n\n```python\n\u003e\u003e\u003e map = obj.MAP( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Normalized Discounted Cumulative Gain\n\n```python\n\u003e\u003e\u003e map = obj.nDCG( user_id,\n                    retrieved,\n                    topn = 10,\n                    relevance_threshold = 0,\n                    include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n### \u003ca name=\"itemavg\"\u003e pyreclab.ItemAvg \u003c/a\u003e\n\n * Instance creation\n\n```python\n\u003e\u003e\u003e obj = pyreclab.ItemAvg( dataset = filename,\n                            dlmchar = b'\\t',\n                            header = False,\n                            usercol = 0,\n                            itemcol = 1,\n                            ratingcol = 2 )\n```\n\n| Parameter | Type      | Default value | Description                                                 |\n|:----------|:---------:|:-------------:|:------------------------------------------------------------|\n| dataset   | mandatory | N.A.          | Dataset filename with fields: userid, itemid and rating     |\n| dlmchar   | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header    | optional  | False         | Whether dataset filename contains a header line to skip     |\n| usercol   | optional  | 0             | User column position in dataset file                        |\n| itemcol   | optional  | 1             | Item column position in dataset file                        |\n| ratingcol | optional  | 2             | Rating column position in dataset file                      |\n\n * Training\n\n```python\n\u003e\u003e\u003e obj.train( progress = False )\n```\n\n| Parameter | Type      | Default value | Description       |\n|:----------|:---------:|:-------------:|:------------------|\n| progress  | optional  | False         | Show progress bar |\n\n * Rating prediction\n\n```python\n\u003e\u003e\u003e prediction = obj.predict( userId, itemId )\n```\n\n| Parameter | Type      | Default value | Description       |\n|:----------|:---------:|:-------------:|:------------------|\n| userId    | mandatory | N.A.          | User identifier   |\n| itemId    | mandatory | N.A.          | Item identifier   |\n\n * Top-N item recommendation\n\n```python\n\u003e\u003e\u003e ranking = obj.recommend( userId, topN, includeRated )\n```\n\n| Parameter    | Type      | Default value | Description                               |\n|:-------------|:---------:|:-------------:|:------------------------------------------|\n| userId       | mandatory | N.A.          | User identifier                           |\n| topN         | optional  | 10            | Top N items to recommend                  |\n| includeRated | optional  | False         | Include rated items in ranking generation |\n\n * Testing and evaluation for prediction\n\n```python\n\u003e\u003e\u003e predictionList, mae, rmse = obj.test( input_file = testset,\n                                          dlmchar = b'\\t',\n                                          header = False,\n                                          usercol = 0,\n                                          itemcol = 1,\n                                          ratingcol = 2,\n                                          output_file = 'predictions.csv' )\n```\n\n| Parameter   | Type      | Default value | Description                                                 |\n|:------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file  | mandatory | N.A.          | Testset filename                                            |\n| dlmchar     | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header      | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol     | optional  | 0             | User column position in dataset file                        |\n| itemcol     | optional  | 1             | Item column position in dataset file                        |\n| ratingcol   | optional  | 2             | Rating column position in dataset file                      |\n| output_file | optional  | N.A.          | Output file to write predictions                            |\n\n * Testing for recommendation\n\n```python\n\u003e\u003e\u003e recommendationList, map, ndcg = obj.testrec( input_file = testset,\n                                                 dlmchar = b'\\t',\n                                                 header = False,\n                                                 usercol = 0,\n                                                 itemcol = 1,\n                                                 ratingcol = 2,\n                                                 topn = 10,\n                                                 output_file = 'ranking.json',\n                                                 relevance_threshold = 2,\n                                                 includeRated = False )\n```\n\n| Parameter    | Type      | Default value | Description                                                 |\n|:-------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file   | mandatory | N.A.          | Testset filename                                            |\n| dlmchar      | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header       | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol      | optional  | 0             | User column position in dataset file                        |\n| itemcol      | optional  | 1             | Item column position in dataset file                        |\n| ratingcol    | optional  | 2             | Rating column position in dataset file                      |\n| topn         | optional  | 10            | Top N items to recommend                                    |\n| output_file  | optional  | N.A.          | Output file to write predictions                            |\n| relevance_threshold | optional  | 0          | Lower threshold to consider an item as relevant ( threshold value included ) |\n| includeRated | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Precision\n\n```python\n\u003e\u003e\u003e precision = obj.precision( user_id,\n                               retrieved,\n                               topn = 10,\n                               relevance_threshold = 0,\n                               include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Recall\n\n```python\n\u003e\u003e\u003e recall = obj.recall( user_id,\n                         retrieved,\n                         topn = 10,\n                         relevance_threshold = 0,\n                         include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Area Under the ROC Curve (AUC)\n\n```python\n\u003e\u003e\u003e auc = obj.AUC( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Mean Average precision\n\n```python\n\u003e\u003e\u003e map = obj.MAP( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Normalized Discounted Cumulative Gain\n\n```python\n\u003e\u003e\u003e map = obj.nDCG( user_id,\n                    retrieved,\n                    topn = 10,\n                    relevance_threshold = 0,\n                    include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n### \u003ca name=\"slopeone\"\u003e pyreclab.SlopeOne \u003c/a\u003e\n\n * Instance creation\n\n```python\n\u003e\u003e\u003e obj = pyreclab.SlopeOne( dataset = filename,\n                             dlmchar = b'\\t',\n                             header = False,\n                             usercol = 0,\n                             itemcol = 1,\n                             ratingcol = 2 )\n```\n\n| Parameter | Type      | Default value | Description                                                 |\n|:----------|:---------:|:-------------:|:------------------------------------------------------------|\n| dataset   | mandatory | N.A.          | Dataset filename with fields: userid, itemid and rating     |\n| dlmchar   | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header    | optional  | False         | Whether dataset filename contains a header line to skip     |\n| usercol   | optional  | 0             | User column position in dataset file                        |\n| itemcol   | optional  | 1             | Item column position in dataset file                        |\n| ratingcol | optional  | 2             | Rating column position in dataset file                      |\n\n * Training\n\n```python\n\u003e\u003e\u003e obj.train( progress = False )\n```\n\n| Parameter | Type      | Default value | Description       |\n|:----------|:---------:|:-------------:|:------------------|\n| progress  | optional  | False         | Show progress bar |\n\n * Rating prediction\n\n```python\nprediction = obj.predict( userId, itemId )\n```\n\n| Parameter | Type      | Default value | Description       |\n|:----------|:---------:|:-------------:|:------------------|\n| userId    | mandatory | N.A.          | User identifier   |\n| itemId    | mandatory | N.A.          | Item identifier   |\n\n * Top-N item recommendation\n\n```python\n\u003e\u003e\u003e ranking = obj.recommend( userId, topN, includeRated )\n```\n\n| Parameter    | Type      | Default value | Description                               |\n|:-------------|:---------:|:-------------:|:------------------------------------------|\n| userId       | mandatory | N.A.          | User identifier                           |\n| topN         | optional  | 10            | Top N items to recommend                  |\n| includeRated | optional  | False         | Include rated items in ranking generation |\n\n * Testing and evaluation for prediction\n\n```python\n\u003e\u003e\u003e predictionList, mae, rmse = obj.test( input_file = testset,\n                                          dlmchar = b'\\t',\n                                          header = False,\n                                          usercol = 0,\n                                          itemcol = 1,\n                                          ratingcol = 2,\n                                          output_file = 'predictions.csv' )\n```\n\n| Parameter   | Type      | Default value | Description                                                 |\n|:------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file  | mandatory | N.A.          | Testset filename                                            |\n| dlmchar     | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header      | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol     | optional  | 0             | User column position in dataset file                        |\n| itemcol     | optional  | 1             | Item column position in dataset file                        |\n| ratingcol   | optional  | 2             | Rating column position in dataset file                      |\n| output_file | optional  | N.A.          | Output file to write predictions                            |\n\n * Testing for recommendation\n\n```python\n\u003e\u003e\u003e recommendationList, map, ndcg = obj.testrec( input_file = testset,\n                                                 dlmchar = b'\\t',\n                                                 header = False,\n                                                 usercol = 0,\n                                                 itemcol = 1,\n                                                 ratingcol = 2,\n                                                 topn = 10,\n                                                 output_file = 'ranking.json',\n                                                 relevance_threshold = 2,\n                                                 includeRated = False )\n```\n\n| Parameter    | Type      | Default value | Description                                                 |\n|:-------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file   | mandatory | N.A.          | Testset filename                                            |\n| dlmchar      | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header       | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol      | optional  | 0             | User column position in dataset file                        |\n| itemcol      | optional  | 1             | Item column position in dataset file                        |\n| ratingcol    | optional  | 2             | Rating column position in dataset file                      |\n| topn         | optional  | 10            | Top N items to recommend                                    |\n| output_file  | optional  | N.A.          | Output file to write predictions                            |\n| relevance_threshold | optional  | 0          | Lower threshold to consider an item as relevant ( threshold value included ) |\n| includeRated | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Precision\n\n```python\n\u003e\u003e\u003e precision = obj.precision( user_id,\n                               retrieved,\n                               topn = 10,\n                               relevance_threshold = 0,\n                               include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Recall\n\n```python\n\u003e\u003e\u003e recall = obj.recall( user_id,\n                         retrieved,\n                         topn = 10,\n                         relevance_threshold = 0,\n                         include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Area Under the ROC Curve (AUC)\n\n```python\n\u003e\u003e\u003e auc = obj.AUC( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Mean Average precision\n\n```python\n\u003e\u003e\u003e map = obj.MAP( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Normalized Discounted Cumulative Gain\n\n```python\n\u003e\u003e\u003e map = obj.nDCG( user_id,\n                    retrieved,\n                    topn = 10,\n                    relevance_threshold = 0,\n                    include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n### \u003ca name=\"userknn\"\u003e pyreclab.UserKnn \u003c/a\u003e\n\n * Instance creation\n\n```python\n\u003e\u003e\u003e obj = pyreclab.UserKnn( dataset = filename,\n                            dlmchar = b'\\t',\n                            header = False,\n                            usercol = 0,\n                            itemcol = 1,\n                            ratingcol = 2 )\n```\n\n| Parameter | Type      | Default value | Description                                                 |\n|:----------|:---------:|:-------------:|:------------------------------------------------------------|\n| dataset   | mandatory | N.A.          | Dataset filename with fields: userid, itemid and rating     |\n| dlmchar   | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header    | optional  | False         | Whether dataset filename contains a header line to skip     |\n| usercol   | optional  | 0             | User column position in dataset file                        |\n| itemcol   | optional  | 1             | Item column position in dataset file                        |\n| ratingcol | optional  | 2             | Rating column position in dataset file                      |\n\n * Training\n\n```python\n\u003e\u003e\u003e obj.train( knn, similarity, progress = False )\n```\n\n| Parameter  | Type      | Default value | Valid values      | Description         |\n|:-----------|:---------:|:-------------:|:-----------------:|:--------------------|\n| knn        | optional  | 10            | positive integer  | K nearest neighbors |\n| similarity | optional  | 'pearson'     |'pearson', 'cosine'| Similarity metric   |\n| progress   | optional  | False         |                   | Show progress bar   |\n\n * Rating prediction\n\n```python\n\u003e\u003e\u003e prediction = obj.predict( userId, itemId )\n```\n\n| Parameter | Type      | Default value | Description       |\n|:----------|:---------:|:-------------:|:------------------|\n| userId    | mandatory | N.A.          | User identifier   |\n| itemId    | mandatory | N.A.          | Item identifier   |\n\n * Top-N item recommendation\n\n```python\n\u003e\u003e\u003e ranking = obj.recommend( userId, topN, includeRated )\n```\n\n| Parameter    | Type      | Default value | Description                               |\n|:-------------|:---------:|:-------------:|:------------------------------------------|\n| userId       | mandatory | N.A.          | User identifier                           |\n| topN         | optional  | 10            | Top N items to recommend                  |\n| includeRated | optional  | False         | Include rated items in ranking generation |\n\n * Testing and evaluation for prediction\n\n```python\n\u003e\u003e\u003e predictionList, mae, rmse = obj.test( input_file = testset,\n                                          dlmchar = b'\\t',\n                                          header = False,\n                                          usercol = 0,\n                                          itemcol = 1,\n                                          ratingcol = 2,\n                                          output_file = 'predictions.csv' )\n```\n\n| Parameter   | Type      | Default value | Description                                                 |\n|:------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file  | mandatory | N.A.          | Testset filename                                            |\n| dlmchar     | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header      | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol     | optional  | 0             | User column position in dataset file                        |\n| itemcol     | optional  | 1             | Item column position in dataset file                        |\n| ratingcol   | optional  | 2             | Rating column position in dataset file                      |\n| output_file | optional  | N.A.          | Output file to write predictions                            |\n\n * Testing for recommendation\n\n```python\n\u003e\u003e\u003e recommendationList, map, ndcg = obj.testrec( input_file = testset,\n                                                 dlmchar = b'\\t',\n                                                 header = False,\n                                                 usercol = 0,\n                                                 itemcol = 1,\n                                                 ratingcol = 2,\n                                                 topn = 10,\n                                                 output_file = 'ranking.json',\n                                                 relevance_threshold = 2,\n                                                 includeRated = False )\n```\n\n| Parameter    | Type      | Default value | Description                                                 |\n|:-------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file   | mandatory | N.A.          | Testset filename                                            |\n| dlmchar      | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header       | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol      | optional  | 0             | User column position in dataset file                        |\n| itemcol      | optional  | 1             | Item column position in dataset file                        |\n| ratingcol    | optional  | 2             | Rating column position in dataset file                      |\n| topn         | optional  | 10            | Top N items to recommend                                    |\n| output_file  | optional  | N.A.          | Output file to write predictions                            |\n| relevance_threshold | optional  | 0          | Lower threshold to consider an item as relevant ( threshold value included ) |\n| includeRated | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Precision\n\n```python\n\u003e\u003e\u003e precision = obj.precision( user_id,\n                               retrieved,\n                               topn = 10,\n                               relevance_threshold = 0,\n                               include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Recall\n\n```python\n\u003e\u003e\u003e recall = obj.recall( user_id,\n                         retrieved,\n                         topn = 10,\n                         relevance_threshold = 0,\n                         include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Area Under the ROC Curve (AUC)\n\n```python\n\u003e\u003e\u003e auc = obj.AUC( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Mean Average precision\n\n```python\n\u003e\u003e\u003e map = obj.MAP( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Normalized Discounted Cumulative Gain\n\n```python\n\u003e\u003e\u003e map = obj.nDCG( user_id,\n                    retrieved,\n                    topn = 10,\n                    relevance_threshold = 0,\n                    include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n### \u003ca name=\"itemknn\"\u003e pyreclab.ItemKnn \u003c/a\u003e\n\n * Instance creation\n\n```python\n\u003e\u003e\u003e obj = pyreclab.ItemKnn( dataset = filename,\n                            dlmchar = b'\\t',\n                            header = False,\n                            usercol = 0,\n                            itemcol = 1,\n                            ratingcol = 2 )\n```\n\n| Parameter | Type      | Default value | Description                                                 |\n|:----------|:---------:|:-------------:|:------------------------------------------------------------|\n| dataset   | mandatory | N.A.          | Dataset filename with fields: userid, itemid and rating     |\n| dlmchar   | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header    | optional  | False         | Whether dataset filename contains a header line to skip     |\n| usercol   | optional  | 0             | User column position in dataset file                        |\n| itemcol   | optional  | 1             | Item column position in dataset file                        |\n| ratingcol | optional  | 2             | Rating column position in dataset file                      |\n\n * Training\n\n```python\n\u003e\u003e\u003e obj.train( knn, similarity, progress = False )\n```\n\n| Parameter  | Type      | Default value | Valid values      | Description         |\n|:-----------|:---------:|:-------------:|:-----------------:|:--------------------|\n| knn        | optional  | 10            | positive integer  | K nearest neighbors |\n| similarity | optional  | 'pearson'     |'pearson', 'cosine'| Similarity metric   |\n| progress   | optional  | False         |                   | Show progress bar   |\n\n * Rating prediction\n\n```python\n\u003e\u003e\u003e prediction = obj.predict( userId, itemId )\n```\n\n| Parameter | Type      | Default value | Description       |\n|:----------|:---------:|:-------------:|:------------------|\n| userId    | mandatory | N.A.          | User identifier   |\n| itemId    | mandatory | N.A.          | Item identifier   |\n\n * Top-N item recommendation\n\n```python\n\u003e\u003e\u003e ranking = obj.recommend( userId, topN, includeRated )\n```\n\n| Parameter    | Type      | Default value | Description                               |\n|:-------------|:---------:|:-------------:|:------------------------------------------|\n| userId       | mandatory | N.A.          | User identifier                           |\n| topN         | optional  | 10            | Top N items to recommend                  |\n| includeRated | optional  | False         | Include rated items in ranking generation |\n\n * Testing and evaluation for prediction\n\n```python\n\u003e\u003e\u003e predictionList, mae, rmse = obj.test( input_file = testset,\n                                          dlmchar = b'\\t',\n                                          header = False,\n                                          usercol = 0,\n                                          itemcol = 1,\n                                          ratingcol = 2,\n                                          output_file = 'predictions.csv' )\n```\n\n| Parameter   | Type      | Default value | Description                                                 |\n|:------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file  | mandatory | N.A.          | Testset filename                                            |\n| dlmchar     | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header      | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol     | optional  | 0             | User column position in dataset file                        |\n| itemcol     | optional  | 1             | Item column position in dataset file                        |\n| ratingcol   | optional  | 2             | Rating column position in dataset file                      |\n| output_file | optional  | N.A.          | Output file to write predictions                            |\n\n * Testing for recommendation\n\n```python\n\u003e\u003e\u003e recommendationList, map, ndcg = obj.testrec( input_file = testset,\n                                                 dlmchar = b'\\t',\n                                                 header = False,\n                                                 usercol = 0,\n                                                 itemcol = 1,\n                                                 ratingcol = 2,\n                                                 topn = 10,\n                                                 output_file = 'ranking.json',\n                                                 relevance_threshold = 2,\n                                                 includeRated = False )\n```\n\n| Parameter    | Type      | Default value | Description                                                 |\n|:-------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file   | mandatory | N.A.          | Testset filename                                            |\n| dlmchar      | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header       | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol      | optional  | 0             | User column position in dataset file                        |\n| itemcol      | optional  | 1             | Item column position in dataset file                        |\n| ratingcol    | optional  | 2             | Rating column position in dataset file                      |\n| topn         | optional  | 10            | Top N items to recommend                                    |\n| output_file  | optional  | N.A.          | Output file to write predictions                            |\n| relevance_threshold | optional  | 0          | Lower threshold to consider an item as relevant ( threshold value included ) |\n| includeRated | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Precision\n\n```python\n\u003e\u003e\u003e precision = obj.precision( user_id,\n                               retrieved,\n                               topn = 10,\n                               relevance_threshold = 0,\n                               include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Recall\n\n```python\n\u003e\u003e\u003e recall = obj.recall( user_id,\n                         retrieved,\n                         topn = 10,\n                         relevance_threshold = 0,\n                         include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Area Under the ROC Curve (AUC)\n\n```python\n\u003e\u003e\u003e auc = obj.AUC( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Mean Average precision\n\n```python\n\u003e\u003e\u003e map = obj.MAP( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Normalized Discounted Cumulative Gain\n\n```python\n\u003e\u003e\u003e map = obj.nDCG( user_id,\n                    retrieved,\n                    topn = 10,\n                    relevance_threshold = 0,\n                    include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n### \u003ca name=\"svd\"\u003e pyreclab.SVD \u003c/a\u003e\n\n * Instance creation\n\n```python\n\u003e\u003e\u003e obj = pyreclab.SVD( factors = 1000,\n                        dataset = filename,\n                        dlmchar = b'\\t',\n                        header = False,\n                        usercol = 0,\n                        itemcol = 1,\n                        ratingcol = 2 )\n```\n\n| Parameter | Type      | Default value | Description                                                 |\n|:----------|:---------:|:-------------:|:------------------------------------------------------------|\n| factors   | optional  | 1000          | Number of latent factors in matrix factorization            |\n| dataset   | mandatory | N.A.          | Dataset filename with fields: userid, itemid and rating     |\n| dlmchar   | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header    | optional  | False         | Whether dataset filename contains a header line to skip     |\n| usercol   | optional  | 0             | User column position in dataset file                        |\n| itemcol   | optional  | 1             | Item column position in dataset file                        |\n| ratingcol | optional  | 2             | Rating column position in dataset file                      |\n\n * Training\n\n```python\n\u003e\u003e\u003e obj.train( maxiter = 100, lr = 0.01, lamb = 0.1, progress = False )\n```\n\n| Parameter | Type      | Default value | Description                                                 |\n|:----------|:---------:|:-------------:|:------------------------------------------------------------|\n| maxiter   | optional  | 100           | Maximum number of iterations reached without convergence    |\n| lr        | optional  | 0.01          | Learning rate                                               |\n| lamb      | optional  | 0.1           | Regularization parameter                                    |\n| progress  | optional  | False         | Show progress bar                                           |\n\n * Rating prediction\n\n```python\n\u003e\u003e\u003e prediction = obj.predict( userId, itemId )\n```\n\n| Parameter | Type      | Default value | Description       |\n|:----------|:---------:|:-------------:|:------------------|\n| userId    | mandatory | N.A.          | User identifier   |\n| itemId    | mandatory | N.A.          | Item identifier   |\n\n * Top-N item recommendation\n\n```python\n\u003e\u003e\u003e ranking = obj.recommend( userId, topN, includeRated )\n```\n\n| Parameter    | Type      | Default value | Description                               |\n|:-------------|:---------:|:-------------:|:------------------------------------------|\n| userId       | mandatory | N.A.          | User identifier                           |\n| topN         | optional  | 10            | Top N items to recommend                  |\n| includeRated | optional  | False         | Include rated items in ranking generation |\n\n * Testing and evaluation for prediction\n\n```python\n\u003e\u003e\u003e predictionList, mae, rmse = obj.test( input_file = testset,\n                                          dlmchar = b'\\t',\n                                          header = False,\n                                          usercol = 0,\n                                          itemcol = 1,\n                                          ratingcol = 2,\n                                          output_file = 'predictions.csv' )\n```\n\n| Parameter   | Type      | Default value | Description                                                 |\n|:------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file  | mandatory | N.A.          | Testset filename                                            |\n| dlmchar     | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header      | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol     | optional  | 0             | User column position in dataset file                        |\n| itemcol     | optional  | 1             | Item column position in dataset file                        |\n| ratingcol   | optional  | 2             | Rating column position in dataset file                      |\n| output_file | optional  | N.A.          | Output file to write predictions                            |\n\n * Testing for recommendation\n\n```python\n\u003e\u003e\u003e recommendationList, map, ndcg = obj.testrec( input_file = testset,\n                                                 dlmchar = b'\\t',\n                                                 header = False,\n                                                 usercol = 0,\n                                                 itemcol = 1,\n                                                 ratingcol = 2,\n                                                 topn = 10,\n                                                 output_file = 'ranking.json',\n                                                 relevance_threshold = 2,\n                                                 includeRated = False )\n```\n\n| Parameter    | Type      | Default value | Description                                                 |\n|:-------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file   | mandatory | N.A.          | Testset filename                                            |\n| dlmchar      | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header       | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol      | optional  | 0             | User column position in dataset file                        |\n| itemcol      | optional  | 1             | Item column position in dataset file                        |\n| ratingcol    | optional  | 2             | Rating column position in dataset file                      |\n| topn         | optional  | 10            | Top N items to recommend                                    |\n| output_file  | optional  | N.A.          | Output file to write predictions                            |\n| relevance_threshold | optional  | 0          | Lower threshold to consider an item as relevant ( threshold value included ) |\n| includeRated | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Precision\n\n```python\n\u003e\u003e\u003e precision = obj.precision( user_id,\n                               retrieved,\n                               topn = 10,\n                               relevance_threshold = 0,\n                               include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Recall\n\n```python\n\u003e\u003e\u003e recall = obj.recall( user_id,\n                         retrieved,\n                         topn = 10,\n                         relevance_threshold = 0,\n                         include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Area Under the ROC Curve (AUC)\n\n```python\n\u003e\u003e\u003e auc = obj.AUC( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Mean Average precision\n\n```python\n\u003e\u003e\u003e map = obj.MAP( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Normalized Discounted Cumulative Gain\n\n```python\n\u003e\u003e\u003e map = obj.nDCG( user_id,\n                    retrieved,\n                    topn = 10,\n                    relevance_threshold = 0,\n                    include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Loss\n\n```python\n\u003e\u003e\u003e current_loss = obj.loss()\n```\n\n\n * Reset factors\n\n```python\n\u003e\u003e\u003e obj.reset()\n```\n\n\n### \u003ca name=\"mostpopular\"\u003e pyreclab.MostPopular \u003c/a\u003e\n\n * Instance creation\n\n```python\n\u003e\u003e\u003e obj = pyreclab.MostPopular( dataset = filename,\n                                dlmchar = b'\\t',\n                                header = False,\n                                usercol = 0,\n                                itemcol = 1,\n                                ratingcol = 2 )\n```\n\n| Parameter | Type      | Default value | Description                                                 |\n|:----------|:---------:|:-------------:|:------------------------------------------------------------|\n| dataset   | mandatory | N.A.          | Dataset filename with fields: userid, itemid and rating     |\n| dlmchar   | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header    | optional  | False         | Whether dataset filename contains a header line to skip     |\n| usercol   | optional  | 0             | User column position in dataset file                        |\n| itemcol   | optional  | 1             | Item column position in dataset file                        |\n| ratingcol | optional  | 2             | Rating column position in dataset file                      |\n\n * Training\n\n```python\n\u003e\u003e\u003e obj.train( progress = False )\n```\n\n| Parameter | Type      | Default value | Description       |\n|:----------|:---------:|:-------------:|:------------------|\n| progress  | optional  | False         | Show progress bar |\n\n * Top-N item recommendation\n\n```python\n\u003e\u003e\u003e ranking = obj.recommend( userId, topN, includeRated )\n```\n\n| Parameter    | Type      | Default value | Description                               |\n|:-------------|:---------:|:-------------:|:------------------------------------------|\n| userId       | mandatory | N.A.          | User identifier                           |\n| topN         | optional  | 10            | Top N items to recommend                  |\n| includeRated | optional  | False         | Include rated items in ranking generation |\n\n\n * Testing for recommendation\n\n```python\n\u003e\u003e\u003e recommendationList, map, ndcg = obj.testrec( input_file = testset,\n                                                 dlmchar = b'\\t',\n                                                 header = False,\n                                                 usercol = 0,\n                                                 itemcol = 1,\n                                                 ratingcol = 2,\n                                                 topn = 10,\n                                                 output_file = 'ranking.json',\n                                                 relevance_threshold = 2,\n                                                 includeRated = False )\n```\n\n| Parameter    | Type      | Default value | Description                                                 |\n|:-------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file   | mandatory | N.A.          | Testset filename                                            |\n| dlmchar      | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header       | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol      | optional  | 0             | User column position in dataset file                        |\n| itemcol      | optional  | 1             | Item column position in dataset file                        |\n| ratingcol    | optional  | 2             | Rating column position in dataset file                      |\n| output_file  | optional  | N.A.          | Output file to write rankings                               |\n| topN         | optional  | 10            | Top N items to recommend                                    |\n| relevance_threshold | optional  | 0          | Lower threshold to consider an item as relevant ( threshold value included ) |\n| includeRated | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Precision\n\n```python\n\u003e\u003e\u003e precision = obj.precision( user_id,\n                               retrieved,\n                               topn = 10,\n                               relevance_threshold = 0,\n                               include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Recall\n\n```python\n\u003e\u003e\u003e recall = obj.recall( user_id,\n                         retrieved,\n                         topn = 10,\n                         relevance_threshold = 0,\n                         include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Area Under the ROC Curve (AUC)\n\n```python\n\u003e\u003e\u003e auc = obj.AUC( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Mean Average precision\n\n```python\n\u003e\u003e\u003e map = obj.MAP( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Normalized Discounted Cumulative Gain\n\n```python\n\u003e\u003e\u003e map = obj.nDCG( user_id,\n                    retrieved,\n                    topn = 10,\n                    relevance_threshold = 0,\n                    include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n### \u003ca name=\"ifals\"\u003e pyreclab.IFAls \u003c/a\u003e\n\n * Instance creation\n\n```python\n\u003e\u003e\u003e obj = pyreclab.IFAls( factors = 50,\n                          dataset = filename,\n                          dlmchar = b'\\t',\n                          header = False,\n                          usercol = 0,\n                          itemcol = 1,\n                          observationcol = 2 )\n```\n\n| Parameter      | Type      | Default value | Description                                                 |\n|:---------------|:---------:|:-------------:|:------------------------------------------------------------|\n| factors        | optional  | 50            | Number of latent factors in matrix factorization            |\n| dataset        | mandatory | N.A.          | Dataset filename with fields: userid, itemid and rating     |\n| dlmchar        | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header         | optional  | False         | Whether dataset filename contains a header line to skip     |\n| usercol        | optional  | 0             | User column position in dataset file                        |\n| itemcol        | optional  | 1             | Item column position in dataset file                        |\n| observationcol | optional  | 2             | Observation column position in dataset file                      |\n\n * Training\n\n```python\n\u003e\u003e\u003e obj.train( maxiter, lambd, progress = False )\n```\n\n| Parameter   | Type      | Default value | Description                                                 |\n|:------------|:---------:|:-------------:|:------------------------------------------------------------|\n| alsNumIter  | optional  | 5             | Number of iterations in ALS algorithm                       |\n| lambd       | optional  | 10            | Regularization parameter                                    |\n| progress    | optional  | False         | Show progress bar                                           |\n\n * Top-N item recommendation\n\n```python\n\u003e\u003e\u003e ranking = obj.recommend( userId, topN, includeRated )\n```\n\n| Parameter    | Type      | Default value | Description                               |\n|:-------------|:---------:|:-------------:|:------------------------------------------|\n| userId       | mandatory | N.A.          | User identifier                           |\n| topN         | optional  | 10            | Top N items to recommend                  |\n| includeRated | optional  | False         | Include rated items in ranking generation |\n\n\n * Testing for recommendation\n\n```python\n\u003e\u003e\u003e recommendationList, map, ndcg = obj.testrec( input_file = testset,\n                                                 dlmchar = b'\\t',\n                                                 header = False,\n                                                 usercol = 0,\n                                                 itemcol = 1,\n                                                 ratingcol = 2,\n                                                 topn = 10,\n                                                 output_file = 'ranking.json',\n                                                 relevance_threshold = 2,\n                                                 includeRated = False )\n```\n\n| Parameter    | Type      | Default value | Description                                                 |\n|:-------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file   | mandatory | N.A.          | Testset filename                                            |\n| dlmchar      | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header       | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol      | optional  | 0             | User column position in dataset file                        |\n| itemcol      | optional  | 1             | Item column position in dataset file                        |\n| ratingcol    | optional  | 2             | Rating column position in dataset file                      |\n| output_file  | optional  | N.A.          | Output file to write rankings                               |\n| topN         | optional  | 10            | Top N items to recommend                                    |\n| relevance_threshold | optional  | 0          | Lower threshold to consider an item as relevant ( threshold value included ) |\n| includeRated | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Precision\n\n```python\n\u003e\u003e\u003e precision = obj.precision( user_id,\n                               retrieved,\n                               topn = 10,\n                               relevance_threshold = 0,\n                               include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Recall\n\n```python\n\u003e\u003e\u003e recall = obj.recall( user_id,\n                         retrieved,\n                         topn = 10,\n                         relevance_threshold = 0,\n                         include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Area Under the ROC Curve (AUC)\n\n```python\n\u003e\u003e\u003e auc = obj.AUC( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Mean Average precision\n\n```python\n\u003e\u003e\u003e map = obj.MAP( user_id,\n                   retrieved,\n                   topn = 10,\n                   relevance_threshold = 0,\n                   include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Normalized Discounted Cumulative Gain\n\n```python\n\u003e\u003e\u003e map = obj.nDCG( user_id,\n                    retrieved,\n                    topn = 10,\n                    relevance_threshold = 0,\n                    include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Reset factors\n\n```python\n\u003e\u003e\u003e obj.reset()\n```\n\n\n### \u003ca name=\"ifalscg\"\u003e pyreclab.IFAlsConjugateGradient \u003c/a\u003e\n\n * Instance creation\n\n```python\n\u003e\u003e\u003e obj = pyreclab.IFAlsConjugateGradient( factors = 50,\n                                           dataset = filename,\n                                           dlmchar = b'\\t',\n                                           header = False,\n                                           usercol = 0,\n                                           itemcol = 1,\n                                           observationcol = 2 )\n```\n\n| Parameter      | Type      | Default value | Description                                                 |\n|:---------------|:---------:|:-------------:|:------------------------------------------------------------|\n| factors        | optional  | 50            | Number of latent factors in matrix factorization            |\n| dataset        | mandatory | N.A.          | Dataset filename with fields: userid, itemid and rating     |\n| dlmchar        | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header         | optional  | False         | Whether dataset filename contains a header line to skip     |\n| usercol        | optional  | 0             | User column position in dataset file                        |\n| itemcol        | optional  | 1             | Item column position in dataset file                        |\n| observationcol | optional  | 2             | Observation column position in dataset file                 |\n\n * Training\n\n```python\n\u003e\u003e\u003e obj.train( alsNumIter, lambd, cgNumIter, progress = False )\n```\n\n| Parameter   | Type      | Default value | Description                                                 |\n|:------------|:---------:|:-------------:|:------------------------------------------------------------|\n| alsNumIter  | optional  | 5             | Number of iterations in ALS algorithm                       |\n| lambd       | optional  | 10            | Regularization parameter                                    |\n| cgNumIter   | optional  | 2             | Number of iterations in Conjugate Gradient algorithm        |\n| progress    | optional  | False         | Show progress bar                                           |\n\n * Top-N item recommendation\n\n```python\n\u003e\u003e\u003e ranking = obj.recommend( userId, topN, includeRated )\n```\n\n| Parameter    | Type      | Default value | Description                               |\n|:-------------|:---------:|:-------------:|:------------------------------------------|\n| userId       | mandatory | N.A.          | User identifier                           |\n| topN         | optional  | 10            | Top N items to recommend                  |\n| includeRated | optional  | False         | Include rated items in ranking generation |\n\n\n * Testing for recommendation\n\n```python\n\u003e\u003e\u003e recommendationList, map, ndcg = obj.testrec( input_file = testset,\n                                                 dlmchar = b'\\t',\n                                                 header = False,\n                                                 usercol = 0,\n                                                 itemcol = 1,\n                                                 ratingcol = 2,\n                                                 topn = 10,\n                                                 output_file = 'ranking.json',\n                                                 relevance_threshold = 2,\n                                                 includeRated = False )\n```\n\n| Parameter    | Type      | Default value | Description                                                 |\n|:-------------|:---------:|:-------------:|:------------------------------------------------------------|\n| input_file   | mandatory | N.A.          | Testset filename                                            |\n| dlmchar      | optional  | tab           | Delimiter character between fields (userid, itemid, rating) |\n| header       | optional  | False         | Dataset filename contains first line header to skip         |\n| usercol      | optional  | 0             | User column position in dataset file                        |\n| itemcol      | optional  | 1             | Item column position in dataset file                        |\n| ratingcol    | optional  | 2             | Rating column position in dataset file                      |\n| output_file  | optional  | N.A.          | Output file to write rankings                               |\n| topN         | optional  | 10            | Top N items to recommend                                    |\n| relevance_threshold | optional  | 0          | Lower threshold to consider an item as relevant ( threshold value included ) |\n| includeRated | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Precision\n\n```python\n\u003e\u003e\u003e precision = obj.precision( user_id,\n                               retrieved,\n                               topn = 10,\n                               relevance_threshold = 0,\n                               include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrieved           | optional  | N.A.          | Recommendation list for user 'user_id'                      |\n| topn                | optional  | 10            | Top N items to recommend. If 'retrieved' is provided, this value will be set to 'retrieved' length |\n| relevance_threshold | optional  | 0             | Lower threshold to consider an item as relevant ( threshold value included ) |\n| include_rated       | optional  | False         | Include rated items in ranking generation                   |\n\n\n * Recall\n\n```python\n\u003e\u003e\u003e recall = obj.recall( user_id,\n                         retrieved,\n                         topn = 10,\n                         relevance_threshold = 0,\n                         include_rated = False )\n```\n\n| Parameter           | Type      | Default value | Description                                                 |\n|:--------------------|:---------:|:-------------:|:------------------------------------------------------------|\n| user_id             | mandatory | N.A.          | User identifier                                             |\n| retrie","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgasevi%2Fpyreclab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgasevi%2Fpyreclab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgasevi%2Fpyreclab/lists"}