class_docstr: This masks out tabular features by integrating over the given background dataset.
  
  Unlike Independent, Partition respects a hierarchical structure of the data.
class_docstr_tok: ["This","masks","out","tabular","features","by","integrating","over","the","given","background","dataset",".","Unlike","Independent",",","Partition","respects","a","hierarchical","structure","of","the","data","."]
docstr: Build a Partition masker with the given background data and clustering.
  
  Parameters
  ----------
  data : numpy.ndarray, pandas.DataFrame
      The background dataset that is used for masking.
  
  max_samples : int
      The maximum number of samples to use from the passed background data. If data has more
      than max_samples then shap.utils.sample is used to subsample the dataset. The number of
      samples coming out of the masker (to be integrated over) matches the number of samples in
      the background dataset. This means larger background dataset cause longer runtimes. Normally
      about 1, 10, 100, or 1000 background samples are reasonable choices.
  
  clustering : string or numpy.ndarray
      If a string, then this is the distance metric to use for creating the clustering of
      the features. The distance function can be any valid scipy.spatial.distance.pdist's metric
      argument. However we suggest using 'correlation' in most cases. The full list of options is
      `braycurtis`, `canberra`, `chebyshev`, `cityblock`, `correlation`, `cosine`, `dice`,
      `euclidean`, `hamming`, `jaccard`, `jensenshannon`, `kulsinski`, `mahalanobis`,
      `matching`, `minkowski`, `rogerstanimoto`, `russellrao`, `seuclidean`,
      `sokalmichener`, `sokalsneath`, `sqeuclidean`, `yule`. These are all
      the options from scipy.spatial.distance.pdist's metric argument.
      If an array, then this is assumed to be the clustering of the features.
docstr_tok: ["Build","a","Partition","masker","with","the","given","background","data","and","clustering",".","Parameters","--","--","--","--","--","data",":","numpy.ndarray",",","pandas.DataFrame","The","background","dataset","that","is","used","for","masking",".","max_samples",":","int","The","maximum","number","of","samples","to","use","from","the","passed","background","data",".","If","data","has","more","than","max_samples","then","shap.utils.sample","is","used","to","subsample","the","dataset",".","The","number","of","samples","coming","out","of","the","masker","(","to","be","integrated","over",")","matches","the","number","of","samples","in","the","background","dataset",".","This","means","larger","background","dataset","cause","longer","runtimes",".","Normally","about","1",",","10",",","100",",","or","1000","background","samples","are","reasonable","choices",".","clustering",":","string","or","numpy.ndarray","If","a","string",",","then","this","is","the","distance","metric","to","use","for","creating","the","clustering","of","the","features",".","The","distance","function","can","be","any","valid","scipy.spatial.distance.pdist","'s","metric","argument",".","However","we","suggest","using","'correlation","'","in","most","cases",".","The","full","list","of","options","is","`","braycurtis","`",",","`","canberra","`",",","`","chebyshev","`",",","`","cityblock","`",",","`","correlation","`",",","`","cosine","`",",","`","dice","`",",","`","euclidean","`",",","`","hamming","`",",","`","jaccard","`",",","`","jensenshannon","`",",","`","kulsinski","`",",","`","mahalanobis","`",",","`","matching","`",",","`","minkowski","`",",","`","rogerstanimoto","`",",","`","russellrao","`",",","`","seuclidean","`",",","`","sokalmichener","`",",","`","sokalsneath","`",",","`","sqeuclidean","`",",","`","yule","`",".","These","are","all","the","options","from","scipy.spatial.distance.pdist","'s","metric","argument",".","If","an","array",",","then","this","is","assumed","to","be","the","clustering","of","the","features","."]
code: def __init__(self, data, max_samples=100, clustering="correlation"):
      """Build a Partition masker with the given background data and clustering.
  
      Parameters
      ----------
      data : numpy.ndarray, pandas.DataFrame
          The background dataset that is used for masking.
  
      max_samples : int
          The maximum number of samples to use from the passed background data. If data has more
          than max_samples then shap.utils.sample is used to subsample the dataset. The number of
          samples coming out of the masker (to be integrated over) matches the number of samples in
          the background dataset. This means larger background dataset cause longer runtimes. Normally
          about 1, 10, 100, or 1000 background samples are reasonable choices.
  
      clustering : string or numpy.ndarray
          If a string, then this is the distance metric to use for creating the clustering of
          the features. The distance function can be any valid scipy.spatial.distance.pdist's metric
          argument. However we suggest using 'correlation' in most cases. The full list of options is
          `braycurtis`, `canberra`, `chebyshev`, `cityblock`, `correlation`, `cosine`, `dice`,
          `euclidean`, `hamming`, `jaccard`, `jensenshannon`, `kulsinski`, `mahalanobis`,
          `matching`, `minkowski`, `rogerstanimoto`, `russellrao`, `seuclidean`,
          `sokalmichener`, `sokalsneath`, `sqeuclidean`, `yule`. These are all
          the options from scipy.spatial.distance.pdist's metric argument.
          If an array, then this is assumed to be the clustering of the features.
      """
      super().__init__(
          data, max_samples=max_samples, clustering=clustering
      )
  
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 1 to create a new Partition object from inherited base classes: Tabular with example: obj = Partition(data, max_samples, clustering)