recbole.evaluator.loss_evaluator¶
-
class
recbole.evaluator.loss_evaluator.
LossEvaluator
(config)[source]¶ Bases:
recbole.evaluator.abstract_evaluator.AbstractEvaluator
Loss Evaluator is mainly used in rating prediction and click through rate prediction. Now, we support four loss metrics which contain ‘AUC’, ‘RMSE’, ‘MAE’, ‘LOGLOSS’.
Note
The metrics used do not calculate group-based metrics which considers the metrics scores averaged across users. They are also not limited to k. Instead, they calculate the scores on the entire prediction results regardless the users.
-
collect
(interaction, pred_scores)[source]¶ collect the loss intermediate result of one batch, this function mainly implements concatenating preds and trues. It is called at the end of each batch
- Parameters
interaction (Interaction) –
AbstractEvaluator
of the batchpred_scores (tensor) – the tensor of model output with a size of (N, )
- Returns
a batch of socres with a size of (N, 2)
- Return type
tensor
-