Coverage Metrics - API Reference¶
Auto-generated documentation for coverage metric classes.
warprec.evaluation.metrics.coverage.item_coverage.ItemCoverage
¶
Bases: TopKMetric
The ItemCoverage@k metric counts the number of unique items that were recommended across all users.
Attributes:
| Name | Type | Description |
|---|---|---|
item_counts |
Tensor
|
The tensor of item counts. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
k
|
int
|
The cutoff. |
required |
num_items
|
int
|
Number of items in the training set. |
required |
dist_sync_on_step
|
bool
|
Torchmetrics parameter. |
False
|
**kwargs
|
Any
|
The keyword argument dictionary. |
{}
|
Source code in warprec/evaluation/metrics/coverage/item_coverage.py
warprec.evaluation.metrics.coverage.user_coverage.UserCoverage
¶
Bases: TopKMetric
The UserCoverage@k metric counts the number of users that received at least one recommendation.
Attributes:
| Name | Type | Description |
|---|---|---|
users |
Tensor
|
The number of users evaluated. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
k
|
int
|
The cutoff. |
required |
dist_sync_on_step
|
bool
|
Torchmetrics parameter. |
False
|
**kwargs
|
Any
|
The keyword argument dictionary. |
{}
|
Source code in warprec/evaluation/metrics/coverage/user_coverage.py
warprec.evaluation.metrics.coverage.numretrieved.NumRetrieved
¶
Bases: UserAverageTopKMetric
The NumRetrieved@k counts the number of items retrieved in the top-k list.
This metric simply counts how many items are present in the recommended list up to the specified cutoff k. It does not consider the relevance of the items.
Source code in warprec/evaluation/metrics/coverage/numretrieved.py
warprec.evaluation.metrics.coverage.user_coverage_at_n.UserCoverageAtN
¶
Bases: TopKMetric
The UserCoverageAtN counts the number of user that retrieved correctly at least N recommendations.
This metric measures the system's ability to provide a sufficiently long recommendation list for users.
Attributes:
| Name | Type | Description |
|---|---|---|
users |
Tensor
|
Number of user with at least 1 relevant item. |
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
k
|
int
|
The cutoff. |
required |
dist_sync_on_step
|
bool
|
Torchmetrics parameter. |
False
|
**kwargs
|
Any
|
The keyword argument dictionary. |
{}
|