class_docstr: Shallow Decision Tree (low depth).
  
  Currently wrapper around DecisionTreeClassifier or DecisionTreeRegressor in scikit-learn.
  To keep the tree shallow, max depth is defaulted to 3.
  
  https://github.com/scikit-learn/scikit-learn
class_docstr_tok: ["Shallow","Decision","Tree","(","low","depth",")",".","Currently","wrapper","around","DecisionTreeClassifier","or","DecisionTreeRegressor","in","scikit-learn",".","To","keep","the","tree","shallow",",","max","depth","is","defaulted","to","3.","https",":","\/\/github.com\/scikit-learn\/scikit-learn"]
docstr: Fits model to provided instances.
  
  Args:
      X: Numpy array for training instances.
      y: Numpy array as training labels.
  
  Returns:
      Itself.
docstr_tok: ["Fits","model","to","provided","instances",".","Args",":","X",":","Numpy","array","for","training","instances",".","y",":","Numpy","array","as","training","labels",".","Returns",":","Itself","."]
code: def fit(self, X, y):
      """Fits model to provided instances.
  
      Args:
          X: Numpy array for training instances.
          y: Numpy array as training labels.
  
      Returns:
          Itself.
      """
  
      y = clean_dimensions(y, "y")
      if y.ndim != 1:
          raise ValueError("y must be 1 dimensional")
      if len(y) == 0:
          raise ValueError("y cannot have 0 samples")
  
      if is_classifier(self):
          y = typify_classification(y)
      else:
          y = y.astype(np.float64, copy=False)
  
      X, n_samples = preclean_X(
          X, self.feature_names, self.feature_types, len(y)
      )
  
      X, self.feature_names_in_, self.feature_types_in_ = unify_data(
          X, n_samples, self.feature_names, self.feature_types, False, 0
      )
  
      model = self._model()
      model.fit(X, y)
  
      unique_val_counts = np.zeros(
          len(self.feature_names_in_), dtype=np.int64
      )
      for col_idx in range(len(self.feature_names_in_)):
          X_col = X[:, col_idx]
          unique_val_counts.itemset(col_idx, len(np.unique(X_col)))
  
      feat_imp = model.feature_importances_
      self.global_selector_ = gen_global_selector(
          len(self.feature_names_in_),
          self.feature_names_in_,
          self.feature_types_in_,
          unique_val_counts,
          feat_imp,
      )
      self.n_samples_ = n_samples
  
      self.n_features_in_ = len(self.feature_names_in_)
      if is_classifier(self):
          self.classes_ = model.classes_
  
      self.has_fitted_ = True
  
      return self
  
imports: from ..api.base import ExplainerMixin, ExplanationMixin
  from ..utils._explanation import gen_name_from_class, gen_local_selector, gen_global_selector, gen_perf_dicts
  from sklearn.base import ClassifierMixin, RegressorMixin
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.tree import DecisionTreeRegressor
  from sklearn.base import is_classifier
  from sklearn.utils.validation import check_is_fitted
  import numpy
  from abc import abstractmethod
  from sklearn.tree import _tree
  from copy import deepcopy
  from ..utils._clean_x import preclean_X
  from ..utils._clean_simple import clean_dimensions, typify_classification
  from ..utils._unify_data import unify_data
  import logging
label_desc: Use image node_id 3 for calling the BaseShallowDecisionTree obj's underlying member method code with example usage: obj.fit(X, y) and returns: self