class_docstr: Implementation of the Efficient MPRT by Hedström et al., 2023.
  
  The Efficient MPRT measures replaces the layer-by-layer pairwise comparison
  between e and ˆe of MPRT by instead computing the relative rise in explanation complexity using only
  two model states, i.e., the original- and fully randomised model version
  
  References:
      1) Hedström, Anna, et al. "Sanity Checks Revisited: An Exploration to Repair the Model Parameter
      Randomisation Test." XAI in Action: Past, Present, and Future Applications. 2023.
  
  Attributes:
      -  _name: The name of the metric.
      - _data_applicability: The data types that the metric implementation currently supports.
      - _models: The model types that this metric can work with.
      - score_direction: How to interpret the scores, whether higher/ lower values are considered better.
      - evaluation_category: What property/ explanation quality that this metric measures.
class_docstr_tok: ["Implementation","of","the","Efficient","MPRT","by","Hedstr\u00f6m","et","al.",",","2023",".","The","Efficient","MPRT","measures","replaces","the","layer-by-layer","pairwise","comparison","between","e","and","\u02c6e","of","MPRT","by","instead","computing","the","relative","rise","in","explanation","complexity","using","only","two","model","states",",","i.e.",",","the","original-","and","fully","randomised","model","version","References",":","1",")","Hedstr\u00f6m",",","Anna",",","et","al",".","``","Sanity","Checks","Revisited",":","An","Exploration","to","Repair","the","Model","Parameter","Randomisation","Test",".","''","XAI","in","Action",":","Past",",","Present",",","and","Future","Applications",".","2023",".","Attributes",":","-","_name",":","The","name","of","the","metric",".","-","_data_applicability",":","The","data","types","that","the","metric","implementation","currently","supports",".","-","_models",":","The","model","types","that","this","metric","can","work","with",".","-","score_direction",":","How","to","interpret","the","scores",",","whether","higher\/","lower","values","are","considered","better",".","-","evaluation_category",":","What","property\/","explanation","quality","that","this","metric","measures","."]
docstr: Find the number of bins for discrete entropy calculation.
  
  Parameters
  ----------
  a_batch: np.array
      Explanatio array to calculate entropy on.
  n_bins_default: int
      Default number of bins to use if no rule is found, default=100.
  min_n_bins: int
      Minimum number of bins to use, default=10.
  max_n_bins: int
      Maximum number of bins to use, default=200.
  debug: boolean
      Indicates whether to print debug information, default=True.
  
  Returns
  -------
  None
docstr_tok: ["Find","the","number","of","bins","for","discrete","entropy","calculation",".","Parameters","--","--","--","--","--","a_batch",":","np.array","Explanatio","array","to","calculate","entropy","on",".","n_bins_default",":","int","Default","number","of","bins","to","use","if","no","rule","is","found",",","default=100",".","min_n_bins",":","int","Minimum","number","of","bins","to","use",",","default=10",".","max_n_bins",":","int","Maximum","number","of","bins","to","use",",","default=200",".","debug",":","boolean","Indicates","whether","to","print","debug","information",",","default=True",".","Returns","--","--","--","-","None"]
code: def find_n_bins(
      self,
      a_batch: np.array,
      n_bins_default: int = 100,
      min_n_bins: int = 10,
      max_n_bins: int = 200,
      debug: bool = True,
  ) -> None:
      """
      Find the number of bins for discrete entropy calculation.
  
      Parameters
      ----------
      a_batch: np.array
          Explanatio array to calculate entropy on.
      n_bins_default: int
          Default number of bins to use if no rule is found, default=100.
      min_n_bins: int
          Minimum number of bins to use, default=10.
      max_n_bins: int
          Maximum number of bins to use, default=200.
      debug: boolean
          Indicates whether to print debug information, default=True.
  
      Returns
      -------
      None
      """
      if self.normalise:
          a_batch = self.normalise_func(
              a_batch, **self.normalise_func_kwargs
          )
  
      if self.abs:
          a_batch = np.abs(a_batch)
  
      if debug:
          print(
              f"\tMax and min value of a_batch=({a_batch.min()}, {a_batch.max()})"
          )
  
      try:
          rule_name = self.complexity_func_kwargs.get("rule", None)
          rule_function = AVAILABLE_N_BINS_ALGORITHMS.get(rule_name)
      except:
          print(
              f"Attempted to use a rule '{rule_name}' that is not available in existing rules: "
              f"{AVAILABLE_N_BINS_ALGORITHMS.keys()}."
          )
  
      if not rule_function:
          self.complexity_func_kwargs["n_bins"] = n_bins_default
          if debug:
              print(f"\tNo rule found, 'n_bins' set to 100.")
          return None
  
      n_bins = rule_function(a_batch=a_batch)
      n_bins = max(min(n_bins, max_n_bins), min_n_bins)
      self.complexity_func_kwargs["n_bins"] = n_bins
  
      if debug:
          print(
              f"\tRule '{rule_name}' -> n_bins={n_bins} but with min={min_n_bins} "
              f"and max={max_n_bins}, 'n_bins' set to {self.complexity_func_kwargs['n_bins']}."
          )
  
imports: import sys
  from typing import Any, Callable, Collection, Dict, List, Optional, Union, Tuple, Generator, Iterable
  import numpy
  from tqdm.auto import tqdm
  from sklearn.utils import gen_batches
  from quantus.functions.similarity_func import correlation_spearman
  from quantus.functions.complexity_func import discrete_entropy, entropy
  from quantus.functions.normalise_func import normalise_by_average_second_moment_estimate
  from quantus.functions import n_bins_func
  from quantus.helpers import asserts, warn, utils
  from quantus.helpers.enums import DataType, EvaluationCategory, ModelType, ScoreDirection
  from quantus.helpers.model.model_interface import ModelInterface
  from quantus.metrics.base import Metric
label_desc: Use image node_id 11 for calling the EfficientMPRT obj's underlying member method code with example usage: obj.find_n_bins(a_batch, n_bins_default, min_n_bins, max_n_bins, debug) and returns: None