class_docstr: An object that implements a callable local decision stump function and
  that also includes some meta-data that allows for an API to interact with
  other methods in the package.
  
  A local decision stump is a tri-valued function that is zero outside of a
  rectangular region, and on that region, takes either a positive or negative
  value, depending on whether a single designated feature is above or below a
  threshold. For more information on what a local decision stump is, refer to
  our paper.
  
  Parameters
  ----------
  feature: int
      Feature used in the decision stump
  threshold: float
      Threshold used in the decision stump
  left_val: float
      The value taken when x_k <= threshold
  right_val: float
      The value taken when x_k > threshold
  a_features: list of ints
      List of ancestor feature indices (ordered from highest ancestor to
      lowest)
  a_thresholds: list of floats
      List of ancestor thresholds (ordered from highest ancestor to lowest)
  a_signs: list of bools
      List of signs indicating whether the current node is in the left child
      (False) or right child (True) of the ancestor nodes (ordered from
      highest ancestor to lowest)
docstr: Return values of the local decision stump function on an input data
  matrix with samples as rows
  
  Parameters
  ----------
  data: array-like of shape (n_samples, n_features)
      Data matrix to feed into the local decision stump function
  
  Returns
  -------
  values: array-like of shape (n_samples,)
      Function values on the data
docstr_tok: ["Return","values","of","the","local","decision","stump","function","on","an","input","data","matrix","with","samples","as","rows","Parameters","--","--","--","--","--","data",":","array-like","of","shape","(","n_samples",",","n_features",")","Data","matrix","to","feed","into","the","local","decision","stump","function","Returns","--","--","--","-","values",":","array-like","of","shape","(","n_samples",",",")","Function","values","on","the","data"]
code: def __call__(self, data):
      """
      Return values of the local decision stump function on an input data
      matrix with samples as rows
  
      Parameters
      ----------
      data: array-like of shape (n_samples, n_features)
          Data matrix to feed into the local decision stump function
  
      Returns
      -------
      values: array-like of shape (n_samples,)
          Function values on the data
      """
  
      root_to_stump_path_indicators = _compare_all(
          data,
          self.a_features,
          np.array(self.a_thresholds),
          np.array(self.a_signs),
      )
      in_node = np.all(root_to_stump_path_indicators, axis=1).astype(
          int
      )
      is_right = _compare(data, self.feature, self.threshold).astype(
          int
      )
      values = in_node * (
          is_right * self.right_val + (1 - is_right) * self.left_val
      )
  
      return values
  
file_path: imodels/imodels/importance/local_stumps.py
imports: import numpy
label_desc: Use image node_id 2 for calling the LocalDecisionStump obj's underlying member method code with example usage: obj.__call__(data) and returns: values