class_docstr: Represents an immutable set of features to be calculated for a single dataframe, and their
  dependencies.
class_docstr_tok: ["Represents","an","immutable","set","of","features","to","be","calculated","for","a","single","dataframe",",","and","their","dependencies","."]
docstr: Generate and return a mapping of {feature name -> depth} in the
  feature DAG for the given dataframe.
docstr_tok: ["Generate","and","return","a","mapping","of","{","feature","name","-",">","depth","}","in","the","feature","DAG","for","the","given","dataframe","."]
code: def _get_feature_depths(self, features):
      """
      Generate and return a mapping of {feature name -> depth} in the
      feature DAG for the given dataframe.
      """
      order = defaultdict(int)
      depths = {}
      queue = features[:]
      while queue:
          # Get the next feature.
          f = queue.pop(0)
  
          depths[f.unique_name()] = order[f.unique_name()]
  
          # Only look at dependencies if they are on the same dataframe.
          if not f.relationship_path:
              dependencies = f.get_dependencies()
              for dep in dependencies:
                  order[dep.unique_name()] = min(
                      order[f.unique_name()] - 1,
                      order[dep.unique_name()],
                  )
                  queue.append(dep)
  
      return depths
  
file_path: featuretools/featuretools/computational_backends/feature_set.py
imports: import itertools
  import logging
  from collections import defaultdict
  from featuretools.entityset.relationship import RelationshipPath
  from featuretools.feature_base import AggregationFeature, FeatureOutputSlice, GroupByTransformFeature, TransformFeature
  from featuretools.utils import Trie
label_desc: Use image node_id 6 for calling the FeatureSet obj's underlying member method code with example usage: obj._get_feature_depths(features) and returns: depths