class_docstr: Implements common methods among tree models:
  - BoostedTreesClassifier
  - BoostedTreesRegression
  - RandomForestClassifier
  - RandomForestRegression
  - DecisionTreeClassifier
  - DecisionTreeRegression
class_docstr_tok: ["Implements","common","methods","among","tree","models",":","-","BoostedTreesClassifier","-","BoostedTreesRegression","-","RandomForestClassifier","-","RandomForestRegression","-","DecisionTreeClassifier","-","DecisionTreeRegression"]
docstr: Extract features along with all the missing features associated with
  a dataset.
  
  Parameters
  ----------
  dataset: bool
      Dataset on which to make predictions.
  
  missing_value_action: str, optional
      Action to perform when missing values are encountered. This can be
      one of:
  
      - 'auto': Choose a model dependent missing value policy.
      - 'impute': Proceed with evaluation by filling in the missing
                  values with the mean of the training data. Missing
                  values are also imputed if an entire column of data is
                  missing during evaluation.
      - 'none': Treat missing value as is. Model must be able to handle
                missing value.
      - 'error' : Do not proceed with prediction and terminate with
                  an error message.
  
  Returns
  -------
  out : SFrame
      A table with two columns:
        - leaf_id          : Leaf id of the corresponding tree.
        - missing_features : A list of missing feature, index pairs
docstr_tok: ["Extract","features","along","with","all","the","missing","features","associated","with","a","dataset",".","Parameters","--","--","--","--","--","dataset",":","bool","Dataset","on","which","to","make","predictions",".","missing_value_action",":","str",",","optional","Action","to","perform","when","missing","values","are","encountered",".","This","can","be","one","of",":","-","'auto","'",":","Choose","a","model","dependent","missing","value","policy",".","-","'impute","'",":","Proceed","with","evaluation","by","filling","in","the","missing","values","with","the","mean","of","the","training","data",".","Missing","values","are","also","imputed","if","an","entire","column","of","data","is","missing","during","evaluation",".","-","'none","'",":","Treat","missing","value","as","is",".","Model","must","be","able","to","handle","missing","value",".","-","'error","'",":","Do","not","proceed","with","prediction","and","terminate","with","an","error","message",".","Returns","--","--","--","-","out",":","SFrame","A","table","with","two","columns",":","-","leaf_id",":","Leaf","id","of","the","corresponding","tree",".","-","missing_features",":","A","list","of","missing","feature",",","index","pairs"]
code: def _extract_features_with_missing(
      self, dataset, tree_id=0, missing_value_action="auto"
  ):
      """
      Extract features along with all the missing features associated with
      a dataset.
  
      Parameters
      ----------
      dataset: bool
          Dataset on which to make predictions.
  
      missing_value_action: str, optional
          Action to perform when missing values are encountered. This can be
          one of:
  
          - 'auto': Choose a model dependent missing value policy.
          - 'impute': Proceed with evaluation by filling in the missing
                      values with the mean of the training data. Missing
                      values are also imputed if an entire column of data is
                      missing during evaluation.
          - 'none': Treat missing value as is. Model must be able to handle
                    missing value.
          - 'error' : Do not proceed with prediction and terminate with
                      an error message.
  
      Returns
      -------
      out : SFrame
          A table with two columns:
            - leaf_id          : Leaf id of the corresponding tree.
            - missing_features : A list of missing feature, index pairs
      """
  
      # Extract the features from only one tree.
      sf = dataset
      sf["leaf_id"] = (
          self.extract_features(dataset, missing_value_action)
          .vector_slice(tree_id)
          .astype(int)
      )
  
      tree = self._get_tree(tree_id)
      type_map = dict(
          zip(dataset.column_names(), dataset.column_types())
      )
  
      def get_missing_features(row):
          x = row["leaf_id"]
          path = tree.get_prediction_path(x)
          missing_id = []  # List of "missing_id" children.
  
          # For each node in the prediction path.
          for p in path:
              fname = p["feature"]
              idx = p["index"]
              f = row[fname]
              if type_map[fname] in [int, float]:
                  if f is None:
                      missing_id.append(p["child_id"])
  
              elif type_map[fname] in [dict]:
                  if f is None:
                      missing_id.append(p["child_id"])
  
                  if idx not in f:
                      missing_id.append(p["child_id"])
              else:
                  pass
          return missing_id
  
      sf["missing_id"] = sf.apply(get_missing_features, list)
      return sf[["leaf_id", "missing_id"]]
  
file_path: turicreate/src/python/turicreate/toolkits/_tree_model_mixin.py
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import turicreate
  from turicreate.toolkits._internal_utils import _raise_error_if_not_sframe
  from turicreate.toolkits._supervised_learning import select_default_missing_value_policy
  from turicreate.toolkits import _coreml_utils
label_desc: Use image node_id 3 for calling the TreeModelMixin obj's underlying member method code with example usage: obj._extract_features_with_missing(dataset, tree_id, missing_value_action) and returns: sf, missing_id