class_docstr: Tree-based model `sklearn`  implementation of the partial dependence for tabular datasets.
  Supports multiple feature interactions. This method is faster than the general black-box implementation
  but is only supported by some tree-based estimators. The computation is based on a weighted tree traversal.
  For more details on the computation, check the `sklearn documentation page`_. The supported `sklearn`
  models are: `GradientBoostingClassifier`, `GradientBoostingRegressor`, `HistGradientBoostingClassifier`,
  `HistGradientBoostingRegressor`, `HistGradientBoostingRegressor`, `DecisionTreeRegressor`, `RandomForestRegressor`.
  
  .. _sklearn documentation page:
          https://scikit-learn.org/stable/modules/partial_dependence.html#computation-methods
class_docstr_tok: ["Tree-based","model","`","sklearn","`","implementation","of","the","partial","dependence","for","tabular","datasets",".","Supports","multiple","feature","interactions",".","This","method","is","faster","than","the","general","black-box","implementation","but","is","only","supported","by","some","tree-based","estimators",".","The","computation","is","based","on","a","weighted","tree","traversal",".","For","more","details","on","the","computation",",","check","the","`","sklearn","documentation","page","`","_",".","The","supported","`","sklearn","`","models","are",":","`","GradientBoostingClassifier","`",",","`","GradientBoostingRegressor","`",",","`","HistGradientBoostingClassifier","`",",","`","HistGradientBoostingRegressor","`",",","`","HistGradientBoostingRegressor","`",",","`","DecisionTreeRegressor","`",",","`","RandomForestRegressor","`",".","..","_sklearn","documentation","page",":","https",":","\/\/scikit-learn.org\/stable\/modules\/partial_dependence.html","#","computation-methods"]
docstr: Initialize tree-based model `sklearn` implementation of partial dependence.
  
  Parameters
  ----------
  predictor
      A tree-based `sklearn` estimator.
  feature_names
      A list of feature names used for displaying results.
  categorical_names
      Dictionary where keys are feature columns and values are the categories for the feature. Necessary to
      identify the categorical features in the dataset. An example for `categorical_names` would be::
  
          category_map = {0: ["married", "divorced"], 3: ["high school diploma", "master's degree"]}
  
  target_names
      A list of target/output names used for displaying results.
  verbose
      Whether to print the progress of the explainer.
  
  Notes
  -----
  The length of the `target_names` should match the number of columns returned by a call to the
  `predictor.decision_function`. In the case of a binary classifier, the decision score consists
  of a single column. Thus, the length of the `target_names` should be one.
docstr_tok: ["Initialize","tree-based","model","`","sklearn","`","implementation","of","partial","dependence",".","Parameters","--","--","--","--","--","predictor","A","tree-based","`","sklearn","`","estimator",".","feature_names","A","list","of","feature","names","used","for","displaying","results",".","categorical_names","Dictionary","where","keys","are","feature","columns","and","values","are","the","categories","for","the","feature",".","Necessary","to","identify","the","categorical","features","in","the","dataset",".","An","example","for","`","categorical_names","`","would","be",":",":","category_map","=","{","0",":","[","``","married","''",",","``","divorced","''","]",",","3",":","[","``","high","school","diploma","''",",","``","master","'s","degree","''","]","}","target_names","A","list","of","target\/output","names","used","for","displaying","results",".","verbose","Whether","to","print","the","progress","of","the","explainer",".","Notes","--","--","-","The","length","of","the","`","target_names","`","should","match","the","number","of","columns","returned","by","a","call","to","the","`","predictor.decision_function","`",".","In","the","case","of","a","binary","classifier",",","the","decision","score","consists","of","a","single","column",".","Thus",",","the","length","of","the","`","target_names","`","should","be","one","."]
code: def __init__(
      self,
      predictor: BaseEstimator,
      feature_names: Optional[List[str]] = None,
      categorical_names: Optional[Dict[int, List[str]]] = None,
      target_names: Optional[List[str]] = None,
      verbose: bool = False,
  ):
      """
      Initialize tree-based model `sklearn` implementation of partial dependence.
  
      Parameters
      ----------
      predictor
          A tree-based `sklearn` estimator.
      feature_names
          A list of feature names used for displaying results.
      categorical_names
          Dictionary where keys are feature columns and values are the categories for the feature. Necessary to
          identify the categorical features in the dataset. An example for `categorical_names` would be::
  
              category_map = {0: ["married", "divorced"], 3: ["high school diploma", "master's degree"]}
  
      target_names
          A list of target/output names used for displaying results.
      verbose
          Whether to print the progress of the explainer.
  
      Notes
      -----
      The length of the `target_names` should match the number of columns returned by a call to the
      `predictor.decision_function`. In the case of a binary classifier, the decision score consists
      of a single column. Thus, the length of the `target_names` should be one.
      """
      super().__init__(
          predictor=predictor,
          feature_names=feature_names,
          categorical_names=categorical_names,
          target_names=target_names,
          verbose=verbose,
      )
  
      # perform sanity checks on the `sklearn` predictor
      self._sanity_check()
  
imports: import copy
  import logging
  import math
  import numbers
  import sys
  from abc import ABC, abstractmethod
  from enum import Enum
  from typing import Callable, Dict, Iterable, List, Optional, Tuple, Union, no_type_check
  import matplotlib.pyplot
  import numpy
  from scipy.stats.mstats import mquantiles
  from sklearn.base import BaseEstimator, is_classifier, is_regressor
  from sklearn.ensemble import RandomForestRegressor
  from sklearn.ensemble._gb import BaseGradientBoosting
  from sklearn.ensemble._hist_gradient_boosting.gradient_boosting import BaseHistGradientBoosting
  from sklearn.tree import DecisionTreeRegressor
  from sklearn.utils.extmath import cartesian
  from sklearn.utils.validation import check_is_fitted
  from tqdm import tqdm
  from alibi.api.defaults import DEFAULT_DATA_PD, DEFAULT_META_PD
  from alibi.api.interfaces import Explainer, Explanation
  from alibi.explainers.ale import get_quantiles
  from alibi.utils import _get_options_string
label_desc: Use image node_id 1 to create a new TreePartialDependence object from inherited base classes: PartialDependenceBase with example: obj = TreePartialDependence(predictor, feature_names, categorical_names, target_names, verbose)