elliot.recommender.knn.user_knn package¶
Submodules¶
elliot.recommender.knn.user_knn.aiolli_ferrari module¶
Created on 23/10/17 @author: Maurizio Ferrari Dacrema
-
class
elliot.recommender.knn.user_knn.aiolli_ferrari.
AiolliSimilarity
(data, maxk=40, shrink=100, similarity='cosine', implicit=False, normalize=True, asymmetric_alpha=0.5, tversky_alpha=1.0, tversky_beta=1.0, row_weights=None)[source]¶ Bases:
object
-
class
elliot.recommender.knn.user_knn.aiolli_ferrari.
Compute_Similarity
(dataMatrix, topK=100, shrink=0, normalize=True, asymmetric_alpha=0.5, tversky_alpha=1.0, tversky_beta=1.0, similarity='cosine', row_weights=None)[source]¶ Bases:
object
-
applyAdjustedCosine
()[source]¶ Remove from every data point the average for the corresponding row :return:
-
applyPearsonCorrelation
()[source]¶ Remove from every data point the average for the corresponding column :return:
-
-
elliot.recommender.knn.user_knn.aiolli_ferrari.
check_matrix
(X, format='csc', dtype=<class 'numpy.float32'>)[source]¶ This function takes a matrix as input and transforms it into the specified format. The matrix in input can be either sparse or ndarray. If the matrix in input has already the desired format, it is returned as-is the dtype parameter is always applied and the default is np.float32 :param X: :param format: :param dtype: :return:
elliot.recommender.knn.user_knn.user_knn module¶
Module description:
-
class
elliot.recommender.knn.user_knn.user_knn.
UserKNN
(data, config, params, *args, **kwargs)[source]¶ Bases:
elliot.recommender.recommender_utils_mixin.RecMixin
,elliot.recommender.base_recommender_model.BaseRecommenderModel
GroupLens: An Open Architecture for Collaborative Filtering of Netnews
For further details, please refer to the paper
- Parameters
neighbors – Number of item neighbors
similarity – Similarity function
implementation – Implementation type (‘aiolli’, ‘classical’)
To include the recommendation model, add it to the config file adopting the following pattern:
models: UserKNN: meta: save_recs: True neighbors: 40 similarity: cosine implementation: aiolli
-
property
name
¶