code: def prediction_difference(
      cf_output: types.JsonDict,
      orig_output: types.JsonDict,
      output_spec: types.JsonDict,
      pred_key: str,
  ) -> float:
      """Returns the difference in prediction between cf_output and orig_output."""
      if isinstance(output_spec[pred_key], types.RegressionScore):
          # regression model. We use the provided threshold to binarize the output.
          cf_pred = cf_output[pred_key]
          orig_pred = orig_output[pred_key]
      else:
          orig_pred_class = np.argmax(orig_output[pred_key])
          cf_pred = cf_output[pred_key][orig_pred_class]
          orig_pred = orig_output[pred_key][orig_pred_class]
      return cf_pred - orig_pred
  
file_path: lit/lit_nlp/components/cf_utils.py
imports: import re
  from typing import Any, Optional, cast
  from lit_nlp.api import types
  import numpy
label_desc: Use image node_id 3 for calling a global function with example usage: prediction_difference(cf_output, orig_output, output_spec, pred_key) and returns: unknown