Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
optionally conditioned on protected attributes. Generalized counts are
based on scores and not on the hard predictions.
Args:
privileged (bool, optional): Boolean prescribing whether to
condition this metric on the `privileged_groups`, if `True`, or
the `unprivileged_groups`, if `False`. Defaults to `None`
meaning this metric is computed over the entire dataset.
Returns:
dict: Number of generalized true positives, generalized false
positives, generalized true negatives, generalized false negatives
(optionally conditioned).
"""
condition = self._to_condition(privileged)
return utils.compute_num_gen_TF_PN(self.dataset.protected_attributes,
self.dataset.labels, self.classified_dataset.scores,
self.dataset.instance_weights,
self.dataset.protected_attribute_names,
self.dataset.favorable_label, self.dataset.unfavorable_label,
condition=condition)