class_docstr: A common base class for Independent and Partition.
      
class_docstr_tok: ["A","common","base","class","for","Independent","and","Partition","."]
docstr: This returns a mask of which features change when we mask them.
  
  This optional masking method allows explainers to avoid re-evaluating the model when
  the features that would have been masked are all invariant.
docstr_tok: ["This","returns","a","mask","of","which","features","change","when","we","mask","them",".","This","optional","masking","method","allows","explainers","to","avoid","re-evaluating","the","model","when","the","features","that","would","have","been","masked","are","all","invariant","."]
code: def invariants(self, x):
      """This returns a mask of which features change when we mask them.
  
      This optional masking method allows explainers to avoid re-evaluating the model when
      the features that would have been masked are all invariant.
      """
  
      # make sure we got valid data
      if x.shape != self.data.shape[1:]:
          raise DimensionError(
              "The passed data does not match the background shape expected by the masker! The data of shape "
              + str(x.shape)
              + " was passed while the masker expected data of shape "
              + str(self.data.shape[1:])
              + "."
          )
  
      return np.isclose(x, self.data)
  
imports: import logging
  import numpy
  import pandas
  from numba import njit
  from ..None import utils
  from .._serializable import Deserializer, Serializer
  from ..utils import MaskedModel
  from ..utils._exceptions import DimensionError, InvalidClusteringError
  from ._masker import Masker
label_desc: Use image node_id 3 for calling the Tabular obj's underlying member method code with example usage: obj.invariants(x) and returns: np