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 theil_index(self):
      outcome = super(MetricJSONExplainer, self).theil_index()
      response = OrderedDict(
          (
              ("metric", "Theil Index"),
              ("message", outcome),
              (
                  "description",
                  "Computed as the generalized entropy of benefit for all individuals in the dataset, with alpha = 1. It measures the inequality in benefit allocation for individuals.",
              ),
              ("ideal", "A value of 0 implies perfect fairness."),
          )
      )
      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 42 for calling the MetricJSONExplainer obj's underlying member method code with example usage: obj.theil_index() and returns: json