CollapseLoops#
Data processor#
- class retentioneering.data_processors_lib.collapse_loops.CollapseLoops(params)[source]#
Find
loopsand create new synthetic events in the paths of all users having such sequences.A
loop- is a sequence of repetitive events. For example “event1 -> event1”- Parameters:
- suffix{“loop”, “count”}, optional
If
None, event_name will be event_name without any changes.
For example “event1 - event1 - event1” –> event1.
If
loop, event_name will be event_name_loop.
For example “event1 - event1 - event1” –> event1_loop.
If
count, event_name will be event_name_loop_{number of events}.
For example “event1 - event1 - event1” –> event1_loop_3.
- time_agg{“max”, “min”, “mean”}, default “min”
Aggregation method to calculate timestamp values for new groups.
- Returns:
- Eventstream
Eventstream with:
raw events: the returned events will be marked
_deleted=Trueand soft-deleted from input eventstream.new synthetic events: the returned events will be added to the input eventstream with columns below.
event_name
event_type
timestamp
event_name_loop
group_alias
min/max/mean(group of repetitive events))
event_name_loop_{count}
group_alias
(min/max/mean(group of repetitive events))
event_name
group_alias
(min/max/mean(group of repetitive events))
See also
StepMatrixThis class provides methods for step matrix calculation and visualization.
RawDataSchemaDefine schema for
raw_datacolumns names.
Notes
If an eventstream contains custom columns they will be aggregated in the following way:
for numeric columns the mean value will be calculated for each collapsed group.
Nonevalues are ignored. Supported numeric types are:bool,int,float.for string columns, if all the values to be aggregated in the collapsing group are equal, this single value will be returned, otherwise -
None.Nonevalues in the input data will be ignored.
See Data processors user guide and Eventstream custom columns’ explanation for the details.
- class retentioneering.data_processors_lib.collapse_loops.CollapseLoopsParams(*, suffix=None, time_agg='min')[source]#
A class with parameters for
CollapseLoopsclass.
Eventstream#
- CollapseLoopsHelperMixin.collapse_loops(suffix=None, time_agg='min')[source]#
A method of
Eventstreamclass that findsloopsand creates new synthetic events in paths of all users having such sequences.A
loop- is a sequence of repetitive events. For example “event1 -> event1”- Parameters:
- See parameters description
- Returns:
- Eventstream
Input
eventstreamwithloopsreplaced by new synthetic events.