recbole.evaluator.register

class recbole.evaluator.register.Register(config)[source]

Bases: object

Register module load the registry according to the metrics in config. It is a member of DataCollector. The DataCollector collect the resource that need for Evaluator under the guidance of Register

has_metric(metric: str)[source]
need(key: str)[source]
recbole.evaluator.register.cluster_info(module_name)[source]

Collect information of all metrics, including:

  • metric_need: Information needed to calculate this metric, the combination of rec.items, rec.topk, rec.meanrank, rec.score, data.num_items, data.num_users, data.count_items, data.count_users, data.label.

  • metric_type: Whether the scores required by metric are grouped by user, range in EvaluatorType.RANKING and EvaluatorType.VALUE.

  • smaller: Whether the smaller metric value represents better performance, range in True and False, default to False.

Note

For metric_type: in current RecBole, all the “grouped-score” metrics are ranking-based and all the “non-grouped-score” metrics are value-based. To keep with our paper, we adopted the more formal terms: RANKING and VALUE.

Parameters

module_name (str) – the name of module recbole.evaluator.metrics.

Returns

Three dictionaries containing the above information and a dictionary matching metric names to metric classes.

Return type

dict