pyepo.metric.unambregret

Unambiguous regret loss

Module Contents

Functions

unambRegret(predmodel, optmodel, dataloader[, tolerance])

A function to evaluate model performance with normalized unambiguous regret

calUnambRegret(optmodel, pred_cost, true_cost, true_obj)

A function to calculate normalized unambiguous regret for a batch

pyepo.metric.unambregret.unambRegret(predmodel, optmodel, dataloader, tolerance=1e-05)

A function to evaluate model performance with normalized unambiguous regret

Parameters:
  • predmodel (nn) – a regression neural network for cost prediction

  • optmodel (optModel) – an PyEPO optimization model

  • dataloader (DataLoader) – Torch dataloader from optDataSet

Returns:

unambiguous regret loss

Return type:

float

pyepo.metric.unambregret.calUnambRegret(optmodel, pred_cost, true_cost, true_obj, tolerance=1e-05)

A function to calculate normalized unambiguous regret for a batch

Parameters:
  • optmodel (optModel) – optimization model

  • pred_cost (torch.tensor) – predicted costs

  • true_cost (torch.tensor) – true costs

  • true_obj (torch.tensor) – true optimal objective values

Returns:

unambiguous regret losses

Return type:

float