composeml.LabelMaker.slice

LabelMaker.slice(df, num_examples_per_instance, minimum_data=None, maximum_data=None, gap=None, drop_empty=True)[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 the search. Default value is first time of index.

  • maximum_data (str) – Maximum data before stopping the search. Default value is last 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.

Returns

Returns a generator of data slices.

Return type

ds (generator)