up identifiers should be ``0, 1, ..., (num_groups - 1)``. threshold: Threshold for transforming probability to binary {0,1} predictions. ignore_index: Specifies a target value that is ignored and does not contribute to the metric calculation validate_args: bool indicating if input arguments and tensors should be validated for correctness. Set to ``False`` for faster computations. Returns: The metric returns a dict where the key identifies the group with the lowest and highest positivity rates as follows: DP_{identifier_low_group}_{identifier_high_group}. The value is a tensor with the DP rate. Example (preds is int tensor): >>> from torchmetrics.functional.classification import demographic_parity >>> preds = torch.tensor([0, 1, 0, 1, 0, 1]) >>> groups = torch.tensor([0, 1, 0, 1, 0, 1]) >>> demographic_parity(preds, groups) {'DP_0_1': tensor(0.)} Example (preds is float tensor): >>> from torchmetrics.functional.classification import demographic_parity >>> preds = torch.tensor([0.11, 0.84, 0.22, 0.73, 0.33, 0.92]) >>> groups = torch.tensor([0, 1, 0, 1, 0, 1]) >>> demographic_parity(preds, groups) {'DP_0_1': tensor(0.)} r