composeml.LabelMaker.slice

LabelMaker.slice(df, num_examples_per_instance, minimum_data=None, gap=None, drop_empty=True, verbose=False)[source]

Generates data slices of target entity.

Parameters:
  • df (DataFrame) – Data frame to create slices on.
  • num_examples_per_instance (int) – Number of examples per unique instance of target entity.
  • minimum_data (str) – Minimum data before starting search. Default value is first time of index.
  • gap (str or int) – Time between examples. Default value is window size. If an integer, search will start on the first event after the minimum data.
  • drop_empty (bool) – Whether to drop empty slices. Default value is True.
  • verbose (bool) – Whether to print metadata about slice. Default value is False.
Returns:

Returns a generator of data slices.

Return type:

ds (generator)