class_docstr: Partial dependence plots as defined in Friedman's paper on
  "Greedy function approximation: a gradient boosting machine".
  
  Friedman, Jerome H. "Greedy function approximation: a gradient boosting machine."
  Annals of statistics (2001): 1189-1232.
class_docstr_tok: ["Partial","dependence","plots","as","defined","in","Friedman","'s","paper","on","''","Greedy","function","approximation",":","a","gradient","boosting","machine","''",".","Friedman",",","Jerome","H.","``","Greedy","function","approximation",":","a","gradient","boosting","machine",".","''","Annals","of","statistics","(","2001",")",":","1189-1232","."]
docstr: Initializes class.
  
  Args:
      model: model or prediction function of model (predict_proba for classification or predict for regression)
      data: Data used to initialize PartialDependence with.
      feature_names: List of feature names.
      feature_types: List of feature types.
      num_points: Number of grid points for the x axis.
      std_coef: Co-efficient for standard deviation.
docstr_tok: ["Initializes","class",".","Args",":","model",":","model","or","prediction","function","of","model","(","predict_proba","for","classification","or","predict","for","regression",")","data",":","Data","used","to","initialize","PartialDependence","with",".","feature_names",":","List","of","feature","names",".","feature_types",":","List","of","feature","types",".","num_points",":","Number","of","grid","points","for","the","x","axis",".","std_coef",":","Co-efficient","for","standard","deviation","."]
code: def __init__(
      self,
      model,
      data,
      feature_names=None,
      feature_types=None,
      num_points=10,
      std_coef=1.0,
  ):
      """Initializes class.
  
      Args:
          model: model or prediction function of model (predict_proba for classification or predict for regression)
          data: Data used to initialize PartialDependence with.
          feature_names: List of feature names.
          feature_types: List of feature types.
          num_points: Number of grid points for the x axis.
          std_coef: Co-efficient for standard deviation.
      """
  
      data, n_samples = preclean_X(data, feature_names, feature_types)
  
      predict_fn, n_classes, _ = determine_classes(
          model, data, n_samples
      )
      if 3 <= n_classes:
          raise Exception("multiclass PDP not supported")
      predict_fn = unify_predict_fn(
          predict_fn, data, 1 if n_classes == 2 else -1
      )
  
      data, self.feature_names_in_, self.feature_types_in_ = unify_data(
          data, n_samples, feature_names, feature_types, False, 0
      )
  
      # Fortran ordered float data is faster since we go by columns, so use that
      data = data.astype(np.float64, order="F", copy=False)
  
      pdps = []
      unique_val_counts = np.zeros(
          len(self.feature_names_in_), dtype=np.int64
      )
      for col_idx, feature in enumerate(self.feature_names_in_):
          feature_type = self.feature_types_in_[col_idx]
          pdp = _gen_pdp(
              data,
              predict_fn,
              col_idx,
              feature_type,
              num_points=num_points,
              std_coef=std_coef,
          )
          pdps.append(pdp)
  
          X_col = data[:, col_idx]
          unique_val_counts.itemset(col_idx, len(np.unique(X_col)))
  
      # TODO: we can probably extract the data in pdps_ to be less opaque
      # to this class and construct the JSONable data later
      self.pdps_ = pdps
      self.unique_val_counts_ = unique_val_counts
  
file_path: interpret/python/interpret-core/interpret/blackbox/_partialdependence.py
imports: from ..api.base import ExplainerMixin, ExplanationMixin
  import numpy
  from ..utils._explanation import gen_name_from_class, gen_global_selector
  from ..utils._clean_x import preclean_X
  from ..utils._unify_predict import determine_classes, unify_predict_fn
  from ..utils._unify_data import unify_data
label_desc: Use image node_id 1 to create a new PartialDependence object from inherited base classes: ExplainerMixin with example: obj = PartialDependence(model, data, feature_names, feature_types, num_points, std_coef)