All Items methodology
AllItemsMethodology(items_list=None)
Bases: Methodology
Class which, given a train set and a test set, has the task to calculate which items must be used in order to generate a recommendation list
With AllItemsMethodology, given a user \(u\), items to recommend for \(u\) are all items that appear in items_list
parameter excluding those items that appear in the train set of \(u\)
If items_list
is None, then the union of items that appear in the train and test set will be considered
PARAMETER | DESCRIPTION |
---|---|
items_list |
Items set that must appear in the recommendation list of every user. If None, all items that appear in the train and test set will be considered |
Source code in clayrs/recsys/methodology.py
320 321 322 323 324 325 |
|
filter_single(user_idx, train_set, test_set)
Method that returns items that needs to be part of the recommendation list of a single user.
Since it's the AllItems Methodology, all items that appear in the items_list
parameter of the constructor
will be returned, except for those that appear in the train set of the user passed as parameter
PARAMETER | DESCRIPTION |
---|---|
user_idx |
User idx (meaning its mapped integer) of which we want to calculate items that must appear in its recommendation list
TYPE:
|
train_set |
TYPE:
|
test_set |
TYPE:
|
Source code in clayrs/recsys/methodology.py
355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 |
|