LabelCroppedPaths#
Data processor#
- class retentioneering.data_processors_lib.label_cropped_paths.LabelCroppedPaths(params)[source]#
- Create new synthetic event(s) for each user based on the timeout threshold: - cropped_leftor- cropped_right- Parameters:
- left_cutoffTuple(float, DATETIME_UNITS), optional
- Threshold value with its unit of measure. The timedelta between the last event in each user’s path and the first event in the whole eventstream is calculated. For users with the timedelta less than the selected - left_cutoff, the new- cropped_leftevent is added.
- right_cutoffTuple(float, DATETIME_UNITS), optional
- Threshold value with its unit of measure. The timedelta between the first event in each user’s path and the last event in the whole eventstream is calculated. For users with timedelta less than the selected - right_cutoff, the new- cropped_rightevent is added.
 
- Returns:
- Eventstream
- Eventstream containing only the generated synthetic events, for users whose paths satisfy the specified cut-offs. - event_name - event_type - timestamp - cropped_left - cropped_left - first_event - cropped_right - cropped_right - last_event 
 
- Raises:
- ValueError
- If both of - left_cutoffand- right_cutoffare empty.
 
 - See also - TimedeltaHist
- Plot the distribution of the time deltas between two events. 
- UserLifetimeHist
- Plot the distribution of user lifetimes. 
 - Notes - See Data processors user guide for the details. 
- class retentioneering.data_processors_lib.label_cropped_paths.LabelCroppedPathsParams(*, left_cutoff=None, right_cutoff=None)[source]#
- A class with parameters for - LabelCroppedPathsclass.
Eventstream#
- LabelCroppedPathsHelperMixin.label_cropped_paths(left_cutoff, right_cutoff)[source]#
- A method of - Eventstreamclass that creates new synthetic event(s) for each user based on the timeout threshold:- cropped_leftand- cropped_right.- Parameters:
- left_cutoffTuple(float, DATETIME_UNITS), optional
- Threshold value with its unit of measure. The timedelta between the last event in each user’s path and the first event in the whole eventstream is calculated. For users with the timedelta less than the selected - left_cutoff, the new- cropped_leftevent is added.
- right_cutoffTuple(float, DATETIME_UNITS), optional
- Threshold value with its unit of measure. The timedelta between the first event in each user’s path and the last event in the whole eventstream is calculated. For users with timedelta less than the selected - right_cutoff, the new- cropped_rightevent is added.
 
- Returns:
- Eventstream
- Input - eventstreamwith new synthetic events.