Test Items methodology
TestItemsMethodology(only_greater_eq=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 TestItemsMethodology, given a user \(u\), items to recommend for \(u\) are all items that appear in the test set of every user excluding those items that appear in the train set of \(u\)
If the only_greater_eq
parameter is set, then only items with rating score \(>=\) only_greater_eq will be
returned
PARAMETER | DESCRIPTION |
---|---|
only_greater_eq |
float which acts as a filter, if specified only items with rating score \(>=\) only_greater_eq will be returned
TYPE:
|
Source code in clayrs/recsys/methodology.py
193 194 195 196 |
|
filter_single(user_idx, train_set, test_set)
Method that returns items that need to be part of the recommendation list of a single user. Since it's the TestItems Methodology, all items that appear in the test set of every user 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
218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 |
|