Skip to main content

pyRecommenderSystem - A Recommender System Python Library

  1. Install
pip install pyRecommenderSystem
  1. Algorithms:
  • Content-Based Filtering: This approach uses a series of descriptions of an item in order to recommend additional items with similar properties . The term "content" refers to these descriptions, and in this case manipulated with TF-IDF matrices. The function returns a list with the k-top similarities (cosine similarity).

    • Xdata = Dataset Attributes. A 0-1 matrix with the content in columns.

    • k = Up to k-top similarities (cosine similarity) that are greater or equal the cut_off value. The default value is 5.

    • show_all = Boolean that indicates if the similiarities of each item will be calculated (show_all = True) or for just one item (show_all = False). The default value is True.

    • graph = Boolean that indicates if the cosine similarity will be displayed (graph = True) or not (graph = False). The default value is True.

    • size = Graph size. The default value is 10.

    • target = k-top similarities of target item. Only relevant if "show_all = False". The default value is "none".

    • cut_off = Value between -1 and 1 that filter similar item according to a certain threshold value. The default value is -0.9999.

  • Collaborative Filtering - Item Based: This approach builds a model from past behaviors, comparing items or users trough ratings, and in this case an Item Based Regression technique is used to predict the missing values. The Grey Wolf Optmizer (GWO) is used to find minimum loss value. The function returns: the prediction of the missing data and the gwo solution.

    • Xdata = Dataset Attributes. A matrix with users ratings about a set of items.

    • user_in_columns = Boolean that indicates if the user is in the column (user_in_column = True) or in the row (user_in_column = False). The default value is True.

    • pack_size = To find the weights, a metaheuristic know as Grey Wolf Optmizer (GWO) is used. The initial population (pack_size) helps to find the optimal solution. The default value is 25.

    • iterations = The total number of iterations. The defaul value is 100

  • Collaborative Filtering - User Based: This approach builds a model from past behaviors, comparing items or users trough ratings, and in this case an User Based Regression technique is used to predict the missing values. The Grey Wolf Optmizer (GWO) is used to find minimum loss value. The function returns: the prediction of the missing data and the gwo solution.

    • Xdata = Dataset Attributes. A matrix with users ratings about a set of items.

    • user_in_columns = Boolean that indicates if the user is in the column (user_in_column = True) or in the row (user_in_column = False). The default value is True.

    • pack_size = To find the weights, a metaheuristic know as Grey Wolf Optmizer (GWO) is used. The initial population (pack_size) helps to find the optimal solution. The default value is 25.

    • iterations = The total number of iterations. The defaul value is 100

  • Collaborative Filtering - User-Item Based: This approach builds a model from past behaviors, comparing items or users trough ratings, and in this case an User-Item Based Regression technique is used to predict the missing values. The Grey Wolf Optmizer (GWO) is used to find minimum loss value. The function returns: the prediction of the missing data and the gwo solution.

    • Xdata = Dataset Attributes. A matrix with users ratings about a set of items.

    • user_in_columns = Boolean that indicates if the user is in the column (user_in_column = True) or in the row (user_in_column = False). The default value is True.

    • pack_size = To find the weights, a metaheuristic know as Grey Wolf Optmizer (GWO) is used. The initial population (pack_size) helps to find the optimal solution. The default value is 25.

    • iterations = The total number of iterations. The defaul value is 100

  • Collaborative Filtering - Latent Factors: This approach builds a model from past behaviors, comparing items or users trough ratings, and in this case a Regression with Latent Factors technique can extract k features to predict the missing values. The Stochastic Gradient Descent is used to find minimum loss value. The function returns: the prediction of the missing data, the users features weights, the items features weights and the rmse (root mean square error).

    • Xdata = Dataset Attributes. A matrix with users ratings about a set of items.

    • mean_centering = "none", "row", "column", "global". If "none" is selected then no centering is made, if "row" is selected then a row mean centering is performed, if "column" is selected then a column mean centering is performed and if "global" is selected then a global centering (matrix mean) is performed. The default value is "none".

    • features = Total number of features to be extracted. The default value is 2.

    • iterations = The total number of iterations. The default value is 1000.

    • alpha = The learning rate. The default value is 0.01.

  • Collaborative Filtering - Nearest Neighbors: This approach builds a model from past behaviors, comparing items or users trough ratings, and in this case the Nearest Neighbors (memory based) is used to calculate the k-top similar users/items (cosine or pearson similarity). The function returns, the k-top similar users/items, the mean and the similarity matrix.

    • Xdata = Dataset Attributes. A matrix with users ratings about a set of items.

    • k = Up to k-top similarities (cosine similarity or pearson correlation) that are greater or equal the cut_off value. The default value is 5.

    • user_in_columns = Boolean that indicates if the user is in the column (user_in_column = True) then a user-user similarity is made, if (user_in_column = False) then an item-item similarity is performed instead. The default value is True.

    • simil = "cosine", "correlation". If "cosine" is chosen then a cosine similarity is performed, and if "correlation" is chosen then a pearson correlation is performed. The default value is "correlation".

    • graph = Boolean that indicates if the similarity matrix will be displayed (graph = True) or not (graph = False). The default value is True.

    • mean_centering = "none", "row", "column", "global". If "none" is selected then no centering is made, if "row" is selected then a row mean centering is performed, if "column" is selected then a column mean centering is performed and if "global" is selected then a global centering (matrix mean) is performed. The default value is "none".

    • cut_off = Value between -1 and 1 that filter similar item according to a certain threshold value. The default value is -0.9999.

    • Finnaly a prediction function - prediction( ) - is also included.

  • Collaborative Filtering - SVD: This approach builds a model from past behaviors, comparing items or users trough ratings, and in this case the SVD (Singular Value Decomposition) technique can extract k features that can be used to find similar users/items. The function returns: the predictions, the rmse (root mean square error), the U matrix (users relation to the features), the Sigma matrix (features matrix)and the V matrix (items relation to the features).

    • Xdata = Dataset Attributes. A matrix with users ratings about a set of items.

    • mean_centering = "none", "row", "column", "global". If "none" is selected then no centering is made, if "row" is selected then a row mean centering is performed, if "column" is selected then a column mean centering is performed and if "global" is selected then a global centering (matrix mean) is performed. The default value is "none".

    • k = Total number of features to be extracted. The default value is 2.

    • user_in_columns = Boolean that indicates if the user is in the column (user_in_column = True) then a user-user similarity is made, if (user_in_column = False) then an item-item similarity is performed instead. The default value is True.

    • graph = Boolean that indicates if the first 2 features of the users and items will be displayed (graph = True) or not (graph = False). The default value is True.

    • size_x = Graph X axis size. The default value is 15.

    • size_y = Graph Y axis size. The default value is 15.

  1. Try it in Colab:

Metadata

Release files for pyRecommenderSystem 1.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyRecommenderSystem 1.5.2
File Size Uploaded
pyRecommenderSystem-1.5.2.tar.gz 14.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyRecommenderSystem 1.5.2
File Interpreter ABI Platform
pyRecommenderSystem-1.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 34.8 kB

Release files / pyRecommenderSystem-1.5.2.tar.gz

Download URL pyRecommenderSystem-1.5.2.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
45d956d6809513b2b281a11e422294e95ccb3d681d31ea6a197a21738b4befb3
BLAKE2b-256 checksum
How to use checksums
520af543e7bbe49bf97a2faf89c6aa3ee0cc7be2eae731eaf7ffd7ddfd7322b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.25.11 tqdm/4.62.2 importlib-metadata/4.8.1 keyring/23.1.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.6

Release files / pyRecommenderSystem-1.5.2-py3-none-any.whl

Download URL pyRecommenderSystem-1.5.2-py3-none-any.whl
Size 20.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
70e8a6bf0b54a38bbbd7cc595c1ae0618b7a3c97d3ad5e5d94e8f2b42d3923b8
BLAKE2b-256 checksum
How to use checksums
4ea3f62da6409490111ce57160000ae2e67cb6081143e89e3019b8762c5effa7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.26.0 requests-toolbelt/0.9.1 urllib3/1.25.11 tqdm/4.62.2 importlib-metadata/4.8.1 keyring/23.1.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.6

Release history Release notifications | RSS feed

This release

1.5.2 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page