composeml.LabelMaker.search¶
- LabelMaker.search(df, num_examples_per_instance, minimum_data=None, maximum_data=None, gap=None, drop_empty=True, verbose=True, *args, **kwargs)[source]¶
Searches the data to calculates labels.
- Parameters
df (DataFrame) – Data frame to search and extract labels.
num_examples_per_instance (int or dict) – The expected number of examples to return from each dataframe group. A dictionary can be used to further specify the expected number of examples to return from each label.
minimum_data (int or str or Series) – The amount of data needed before starting the search. Defaults to the first value in the time index. The value can be a datetime string to directly set the first cutoff time or a timedelta string to denote the amount of data needed before the first cutoff time. The value can also be an integer to denote the number of rows needed before the first cutoff time. If a Series, minimum_data should be datetime string, timedelta string, or integer values with a unique set of target groups as the corresponding index.
maximum_data (str) – Maximum data before stopping the search. Defaults to the last value in the time 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 render progress bar. Default value is True.
*args – Positional arguments for labeling function.
**kwargs – Keyword arguments for labeling function.
- Returns
Calculated labels with cutoff times.
- Return type
lt (LabelTimes)