class_docstr: Simply returns random (normally distributed) feature attributions.
  
  This is only for benchmark comparisons. It supports both fully random attributions and random
  attributions that are constant across all explanations.
docstr: Explains a single row.
          
docstr_tok: ["Explains","a","single","row","."]
code: def explain_row(
      self,
      *row_args,
      max_evals,
      main_effects,
      error_bounds,
      batch_size,
      outputs,
      silent,
  ):
      """Explains a single row."""
  
      # build a masked version of the model for the current input sample
      fm = MaskedModel(
          self.model,
          self.masker,
          self.link,
          self.linearize_link,
          *row_args,
      )
  
      # compute any custom clustering for this row
      row_clustering = None
      if getattr(self.masker, "clustering", None) is not None:
          if isinstance(self.masker.clustering, np.ndarray):
              row_clustering = self.masker.clustering
          elif callable(self.masker.clustering):
              row_clustering = self.masker.clustering(*row_args)
          else:
              raise NotImplementedError(
                  "The masker passed has a .clustering attribute that is not yet supported by the Permutation explainer!"
              )
  
      # compute the correct expected value
      masks = np.zeros(1, dtype=int)
      outputs = fm(masks, zero_index=0, batch_size=1)
      expected_value = outputs[0]
  
      # generate random feature attributions
      # we produce small values so our explanation errors are similar to a constant function
      row_values = (
          np.random.randn(*((len(fm),) + outputs.shape[1:])) * 0.001
      )
  
      return {
          "values": row_values,
          "expected_values": expected_value,
          "mask_shapes": fm.mask_shapes,
          "main_effects": None,
          "clustering": row_clustering,
          "error_std": None,
          "output_names": self.model.output_names
          if hasattr(self.model, "output_names")
          else None,
      }
  
file_path: shap/shap/explainers/other/_random.py
imports: import numpy
  from shap import links
  from shap.models import Model
  from shap.utils import MaskedModel
  from .._explainer import Explainer
label_desc: Use image node_id 2 for calling the Random obj's underlying member method code with example usage: obj.explain_row() and returns: dict