class_docstr: Class for explaining metric values in JSON format.
  
  These briefly explain what a metric is and/or how it is calculated unless
  it is obvious (e.g. accuracy) and print the value.
  
  This class contains JSON explanations for all metric values regardless of
  which subclass they appear in. This will raise an error if the metric does
  not apply (e.g. calling `true_positive_rate` if
  `type(metric) == DatasetMetric`).
class_docstr_tok: ["Class","for","explaining","metric","values","in","JSON","format",".","These","briefly","explain","what","a","metric","is","and\/or","how","it","is","calculated","unless","it","is","obvious","(","e.g",".","accuracy",")","and","print","the","value",".","This","class","contains","JSON","explanations","for","all","metric","values","regardless","of","which","subclass","they","appear","in",".","This","will","raise","an","error","if","the","metric","does","not","apply","(","e.g",".","calling","`","true_positive_rate","`","if","`","type","(","metric",")","==","DatasetMetric","`",")","."]
code: def average_abs_odds_difference(self):
      outcome = super(
          MetricJSONExplainer, self
      ).average_abs_odds_difference()
      response = OrderedDict(
          (
              ("metric", "Average Absolute Odds Difference"),
              ("message", outcome),
              (
                  "numFalsePositivesUnprivileged",
                  self.metric.num_false_positives(privileged=False),
              ),
              (
                  "numNegativesUnprivileged",
                  self.metric.num_negatives(privileged=False),
              ),
              (
                  "numTruePositivesUnprivileged",
                  self.metric.num_true_positives(privileged=False),
              ),
              (
                  "numPositivesUnprivileged",
                  self.metric.num_positives(privileged=False),
              ),
              (
                  "numFalsePositivesPrivileged",
                  self.metric.num_false_positives(privileged=True),
              ),
              (
                  "numNegativesPrivileged",
                  self.metric.num_negatives(privileged=True),
              ),
              (
                  "numTruePositivesPrivileged",
                  self.metric.num_true_positives(privileged=True),
              ),
              (
                  "numPositivesPrivileged",
                  self.metric.num_positives(privileged=True),
              ),
              (
                  "description",
                  "Computed as average difference of false positive rate (false positives / actual negatives) and true positive rate (true positives / actual positives) between unprivileged and privileged groups.",
              ),
              (
                  "ideal",
                  "The ideal value of this metric is 0.0.  A value of < 0 implies higher benefit for the privileged group and a value > 0 implies higher benefit for the unprivileged group.",
              ),
          )
      )
      return json.dumps(response)
  
imports: from collections import OrderedDict
  import json
  from aif360.explainers import MetricTextExplainer
  from aif360.metrics import BinaryLabelDatasetMetric
label_desc: Use image node_id 2 for calling the MetricJSONExplainer obj's underlying member method code with example usage: obj.average_abs_odds_difference() and returns: json