Unpersonalized - API Reference¶
Auto-generated documentation for unpersonalized recommender model classes.
warprec.recommenders.unpersonalized_recommender.pop.Pop
¶
Bases: Recommender
Definition of Popularity unpersonalized model.
This model will recommend items based on their popularity, ensuring that previously seen items are not recommended again.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
params
|
dict
|
The dictionary with the model params. |
required |
info
|
dict
|
The dictionary containing dataset information. |
required |
interactions
|
Interactions
|
The training interactions. |
required |
*args
|
Any
|
Argument for PyTorch nn.Module. |
()
|
seed
|
int
|
The seed to use for reproducibility. |
42
|
**kwargs
|
Any
|
Keyword argument for PyTorch nn.Module. |
{}
|
Source code in warprec/recommenders/unpersonalized_recommender/pop.py
predict(user_indices, *args, item_indices=None, **kwargs)
¶
Prediction using a normalized popularity value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_indices
|
Tensor
|
The batch of user indices. |
required |
*args
|
Any
|
List of arguments. |
()
|
item_indices
|
Optional[Tensor]
|
The batch of item indices. If None, full prediction will be produced. |
None
|
**kwargs
|
Any
|
The dictionary of keyword arguments. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Tensor |
Tensor
|
The score matrix {user x item}. |
Source code in warprec/recommenders/unpersonalized_recommender/pop.py
warprec.recommenders.unpersonalized_recommender.random.Random
¶
Bases: Recommender
Definition of Random unpersonalized model. This model will recommend items based on a random number generator.
Source code in warprec/recommenders/unpersonalized_recommender/random.py
predict(user_indices, *args, item_indices=None, **kwargs)
¶
Prediction using a normalized popularity value.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
user_indices
|
Tensor
|
The batch of user indices. |
required |
*args
|
Any
|
List of arguments. |
()
|
item_indices
|
Optional[Tensor]
|
The batch of item indices. If None, full prediction will be produced. |
None
|
**kwargs
|
Any
|
The dictionary of keyword arguments. |
{}
|
Returns:
| Name | Type | Description |
|---|---|---|
Tensor |
Tensor
|
The score matrix {user x item}. |