locpix.evaluate.metrics.metric_calculation#

metric_calculation(item: item, labels)[source]#

Calculate TP, TN, FP and FN for df for each label present

Parameters:
  • item (datastruc.item) – Item containing the dataframe with gt and pred label

  • labels (list) – List of labels to calculate results for

Returns:

Results

The key is the label and at each index is a dictionary containing TP, TN, FP, FN e.g. {0:{‘TP’: 0.6, ‘FP’:.3, …}, 1:{‘TP’: 0.4, ‘FP’:.2, …}] means we have two labels 0 and 1

Return type:

dict