Step Sankey#
Step Sankey Class#
- class retentioneering.tooling.step_sankey.step_sankey.StepSankey(eventstream)[source]#
A class for the visualization of user paths in stepwise manner using Sankey diagram.
- Parameters:
- eventstreamEventstreamType
See also
Eventstream.step_sankeyCall StepSankey tool as an eventstream method.
CollapseLoopsFind loops and create new synthetic events in the paths of all users having such sequences.
StepMatrixThis class provides methods for step matrix calculation and visualization.
Notes
See StepSankey user guide for the details.
- fit(max_steps=10, threshold=0.05, sorting=None, targets=None)[source]#
Calculate the sankey diagram internal values with the defined parameters. Applying
fitmethod is necessary for the following usage of any visualization or descriptiveStepSankeymethods.- Parameters:
- max_stepsint, default 10
Maximum number of steps in trajectories to include. Should be > 1.
- thresholdfloat | int, default 0.05
Used to remove rare events from the plot. An event is collapsed to
thresholded_Nartificial event if its maximum frequency across all the steps is less than or equal tothreshold. The frequency is set with respect tothresholdtype:If
int- the frequency is the number of unique users who had given event at given step.If
float- percentage of users: the same as forint, but divided by the number of unique users.
The events which are prohibited for collapsing could be enlisted in
targetparameter.- sortinglist of str, optional
Define the order of the events visualized at each step. The events that are not represented in the list will follow after the events from the list.
- targetsstr or list of str, optional
Contain events that are prohibited for collapsing with
thresholdparameter.
- Raises:
- ValueError
If
max_stepsparameter is <= 1.
- plot(autosize=True, width=None, height=None)[source]#
Create a Sankey interactive plot based on the calculated values. Should be used after
fit().- Parameters:
- autosizebool, default True
Plotly autosize parameter. See plotly documentation.
- widthint, optional
Plot’s width (in px). See plotly documentation.
- heightint, optional
Plot’s height (in px). See plotly documentation.
- Returns:
- plotly.graph_objects.Figure
Eventstream#
- Eventstream.step_sankey(max_steps=10, threshold=0.05, sorting=None, targets=None, autosize=True, width=None, height=None, show_plot=True)[source]#
Show a Sankey diagram visualizing the user paths in stepwise manner.
- Parameters:
- show_plotbool, default True
If
True, a sankey diagram is shown.- See other parameters’ description
- Returns:
- StepSankey
A
StepSankeyclass instance fitted to the given parameters.