class_docstr: Automatically produce features for a target dataframe in an Entityset.
  
  Args:
      target_dataframe_name (str): Name of dataframe for which to build features.
  
      entityset (EntitySet): Entityset for which to build features.
  
      agg_primitives (list[str or :class:`.primitives.`], optional):
          list of Aggregation Feature types to apply.
  
          Default: ["sum", "std", "max", "skew", "min", "mean", "count", "percent_true", "num_unique", "mode"]
  
      trans_primitives (list[str or :class:`.primitives.TransformPrimitive`], optional):
          list of Transform primitives to use.
  
          Default: ["day", "year", "month", "weekday", "haversine", "num_words", "num_characters"]
  
      where_primitives (list[str or :class:`.primitives.PrimitiveBase`], optional):
          only add where clauses to these types of Primitives
  
          Default:
  
              ["count"]
  
      groupby_trans_primitives (list[str or :class:`.primitives.TransformPrimitive`], optional):
          list of Transform primitives to make GroupByTransformFeatures with
  
      max_depth (int, optional) : maximum allowed depth of features.
          Default: 2. If -1, no limit.
  
      max_features (int, optional) : Cap the number of generated features to
          this number. If -1, no limit.
  
      allowed_paths (list[list[str]], optional): Allowed dataframe paths to make
          features for. If None, use all paths.
  
      ignore_dataframes (list[str], optional): List of dataframes to
          blacklist when creating features. If None, use all dataframes.
  
      ignore_columns (dict[str -> list[str]], optional): List of specific
          columns within each dataframe to blacklist when creating features.
          If None, use all columns.
  
      seed_features (list[:class:`.FeatureBase`], optional): List of manually
          defined features to use.
  
      drop_contains (list[str], optional): Drop features
          that contains these strings in name.
  
      drop_exact (list[str], optional): Drop features that
          exactly match these strings in name.
  
      where_stacking_limit (int, optional): Cap the depth of the where features.
          Default: 1
  
      primitive_options (dict[str or tuple[str] or PrimitiveBase -> dict or list[dict]], optional):
          Specify options for a single primitive or a group of primitives.
          Lists of option dicts are used to specify options per input for primitives
          with multiple inputs. Each option ``dict`` can have the following keys:
  
  
          ``"include_dataframes"``
              List of dataframes to be included when creating features for
              the primitive(s). All other dataframes will be ignored
              (list[str]).
          ``"ignore_dataframes"``
              List of dataframes to be blacklisted when creating features
              for the primitive(s) (list[str]).
          ``"include_columns"``
              List of specific columns within each dataframe to include when
              creating features for the primitive(s). All other columns
              in a given dataframe will be ignored (dict[str -> list[str]]).
          ``"ignore_columns"``
              List of specific columns within each dataframe to blacklist
              when creating features for the primitive(s) (dict[str ->
              list[str]]).
          ``"include_groupby_dataframes"``
              List of dataframes to be included when finding groupbys. All
              other dataframes will be ignored (list[str]).
          ``"ignore_groupby_dataframes"``
              List of dataframes to blacklist when finding groupbys
              (list[str]).
          ``"include_groupby_columns"``
              List of specific columns within each dataframe to include as
              groupbys, if applicable. All other columns in each
              dataframe will be ignored (dict[str -> list[str]]).
          ``"ignore_groupby_columns"``
              List of specific columns within each dataframe to blacklist
              as groupbys (dict[str -> list[str]]).
class_docstr_tok: ["Automatically","produce","features","for","a","target","dataframe","in","an","Entityset",".","Args",":","target_dataframe_name","(","str",")",":","Name","of","dataframe","for","which","to","build","features",".","entityset","(","EntitySet",")",":","Entityset","for","which","to","build","features",".","agg_primitives","(","list","[","str","or",":","class",":","`",".primitives.","`","]",",","optional",")",":","list","of","Aggregation","Feature","types","to","apply",".","Default",":","[","``","sum","''",",","``","std","''",",","``","max","''",",","``","skew","''",",","``","min","''",",","``","mean","''",",","``","count","''",",","``","percent_true","''",",","``","num_unique","''",",","``","mode","''","]","trans_primitives","(","list","[","str","or",":","class",":","`",".primitives.TransformPrimitive","`","]",",","optional",")",":","list","of","Transform","primitives","to","use",".","Default",":","[","``","day","''",",","``","year","''",",","``","month","''",",","``","weekday","''",",","``","haversine","''",",","``","num_words","''",",","``","num_characters","''","]","where_primitives","(","list","[","str","or",":","class",":","`",".primitives.PrimitiveBase","`","]",",","optional",")",":","only","add","where","clauses","to","these","types","of","Primitives","Default",":","[","``","count","''","]","groupby_trans_primitives","(","list","[","str","or",":","class",":","`",".primitives.TransformPrimitive","`","]",",","optional",")",":","list","of","Transform","primitives","to","make","GroupByTransformFeatures","with","max_depth","(","int",",","optional",")",":","maximum","allowed","depth","of","features",".","Default",":","2",".","If","-1",",","no","limit",".","max_features","(","int",",","optional",")",":","Cap","the","number","of","generated","features","to","this","number",".","If","-1",",","no","limit",".","allowed_paths","(","list","[","list","[","str","]","]",",","optional",")",":","Allowed","dataframe","paths","to","make","features","for",".","If","None",",","use","all","paths",".","ignore_dataframes","(","list","[","str","]",",","optional",")",":","List","of","dataframes","to","blacklist","when","creating","features",".","If","None",",","use","all","dataframes",".","ignore_columns","(","dict","[","str","-",">","list","[","str","]","]",",","optional",")",":","List","of","specific","columns","within","each","dataframe","to","blacklist","when","creating","features",".","If","None",",","use","all","columns",".","seed_features","(","list","[",":","class",":","`",".FeatureBase","`","]",",","optional",")",":","List","of","manually","defined","features","to","use",".","drop_contains","(","list","[","str","]",",","optional",")",":","Drop","features","that","contains","these","strings","in","name",".","drop_exact","(","list","[","str","]",",","optional",")",":","Drop","features","that","exactly","match","these","strings","in","name",".","where_stacking_limit","(","int",",","optional",")",":","Cap","the","depth","of","the","where","features",".","Default",":","1","primitive_options","(","dict","[","str","or","tuple","[","str","]","or","PrimitiveBase","-",">","dict","or","list","[","dict","]","]",",","optional",")",":","Specify","options","for","a","single","primitive","or","a","group","of","primitives",".","Lists","of","option","dicts","are","used","to","specify","options","per","input","for","primitives","with","multiple","inputs",".","Each","option","``","dict","``","can","have","the","following","keys",":","``","``","include_dataframes","''","``","List","of","dataframes","to","be","included","when","creating","features","for","the","primitive","(","s",")",".","All","other","dataframes","will","be","ignored","(","list","[","str","]",")",".","``","``","ignore_dataframes","''","``","List","of","dataframes","to","be","blacklisted","when","creating","features","for","the","primitive","(","s",")","(","list","[","str","]",")",".","``","``","include_columns","''","``","List","of","specific","columns","within","each","dataframe","to","include","when","creating","features","for","the","primitive","(","s",")",".","All","other","columns","in","a","given","dataframe","will","be","ignored","(","dict","[","str","-",">","list","[","str","]","]",")",".","``","``","ignore_columns","''","``","List","of","specific","columns","within","each","dataframe","to","blacklist","when","creating","features","for","the","primitive","(","s",")","(","dict","[","str","-",">","list","[","str","]","]",")",".","``","``","include_groupby_dataframes","''","``","List","of","dataframes","to","be","included","when","finding","groupbys",".","All","other","dataframes","will","be","ignored","(","list","[","str","]",")",".","``","``","ignore_groupby_dataframes","''","``","List","of","dataframes","to","blacklist","when","finding","groupbys","(","list","[","str","]",")",".","``","``","include_groupby_columns","''","``","List","of","specific","columns","within","each","dataframe","to","include","as","groupbys",",","if","applicable",".","All","other","columns","in","each","dataframe","will","be","ignored","(","dict","[","str","-",">","list","[","str","]","]",")",".","``","``","ignore_groupby_columns","''","``","List","of","specific","columns","within","each","dataframe","to","blacklist","as","groupbys","(","dict","[","str","-",">","list","[","str","]","]",")","."]
docstr: Automatically builds feature definitions for target
      dataframe using Deep Feature Synthesis algorithm
  
  Args:
      return_types (list[woodwork.ColumnSchema] or str, optional):
          List of ColumnSchemas defining the types of
          columns to return. If None, defaults to returning all
          numeric, categorical and boolean types. If given as
          the string 'all', use all available return types.
  
      verbose (bool, optional): If True, print progress.
  
  Returns:
      list[BaseFeature]: Returns a list of
          features for target dataframe, sorted by feature depth
          (shallow first).
docstr_tok: ["Automatically","builds","feature","definitions","for","target","dataframe","using","Deep","Feature","Synthesis","algorithm","Args",":","return_types","(","list","[","woodwork.ColumnSchema","]","or","str",",","optional",")",":","List","of","ColumnSchemas","defining","the","types","of","columns","to","return",".","If","None",",","defaults","to","returning","all","numeric",",","categorical","and","boolean","types",".","If","given","as","the","string","'all","'",",","use","all","available","return","types",".","verbose","(","bool",",","optional",")",":","If","True",",","print","progress",".","Returns",":","list","[","BaseFeature","]",":","Returns","a","list","of","features","for","target","dataframe",",","sorted","by","feature","depth","(","shallow","first",")","."]
code: def build_features(self, return_types=None, verbose=False):
      """Automatically builds feature definitions for target
          dataframe using Deep Feature Synthesis algorithm
  
      Args:
          return_types (list[woodwork.ColumnSchema] or str, optional):
              List of ColumnSchemas defining the types of
              columns to return. If None, defaults to returning all
              numeric, categorical and boolean types. If given as
              the string 'all', use all available return types.
  
          verbose (bool, optional): If True, print progress.
  
      Returns:
          list[BaseFeature]: Returns a list of
              features for target dataframe, sorted by feature depth
              (shallow first).
      """
      all_features = {}
  
      self.where_clauses = defaultdict(set)
  
      if return_types is None:
          return_types = [
              ColumnSchema(semantic_tags=["numeric"]),
              ColumnSchema(semantic_tags=["category"]),
              ColumnSchema(logical_type=Boolean),
              ColumnSchema(logical_type=BooleanNullable),
          ]
      elif return_types == "all":
          pass
      else:
          msg = "return_types must be a list, or 'all'"
          assert isinstance(return_types, list), msg
  
      self._run_dfs(
          self.es[self.target_dataframe_name],
          RelationshipPath([]),
          all_features,
          max_depth=self.max_depth,
      )
  
      new_features = list(
          all_features[self.target_dataframe_name].values()
      )
  
      def filt(f):
          # remove identity features of the ID field of the target dataframe
          if (
              isinstance(f, IdentityFeature)
              and f.dataframe_name == self.target_dataframe_name
              and f.column_name
              == self.es[self.target_dataframe_name].ww.index
          ):
              return False
  
          return True
  
      # filter out features with undesired return types
      if return_types != "all":
          new_features = [
              f
              for f in new_features
              if any(
                  True
                  for schema in return_types
                  if is_valid_input(f.column_schema, schema)
              )
          ]
      new_features = list(filter(filt, new_features))
  
      new_features.sort(key=lambda f: f.get_depth())
  
      new_features = self._filter_features(new_features)
  
      if self.max_features > 0:
          new_features = new_features[: self.max_features]
  
      if verbose:
          print("Built {} features".format(len(new_features)))
          verbose = None
      return new_features
  
imports: import functools
  import logging
  import operator
  import warnings
  from collections import defaultdict
  from typing import Any, DefaultDict, Dict, List, Tuple, Type
  from woodwork.column_schema import ColumnSchema
  from woodwork.logical_types import Boolean, BooleanNullable
  from featuretools import primitives
  from featuretools.entityset.entityset import LTI_COLUMN_NAME
  from featuretools.entityset.relationship import RelationshipPath
  from featuretools.feature_base import AggregationFeature, DirectFeature, FeatureBase, GroupByTransformFeature, IdentityFeature, TransformFeature
  from featuretools.feature_base.cache import CacheType, feature_cache
  from featuretools.feature_base.utils import is_valid_input
  from featuretools.primitives.base import AggregationPrimitive, PrimitiveBase, TransformPrimitive
  from featuretools.primitives.options_utils import filter_groupby_matches_by_options, filter_matches_by_options, generate_all_primitive_options, ignore_dataframe_for_primitive
  from featuretools.utils.gen_utils import Library, camel_and_title_to_snake
label_desc: Use image node_id 2 for calling the DeepFeatureSynthesis obj's underlying member method code with example usage: obj.build_features(return_types, verbose) and returns: new_features, True, False