Funnel#

Funnel Class#

class retentioneering.tooling.funnel.funnel.Funnel(eventstream)[source]#

A class for the calculation and visualization of a conversion funnel.

Parameters:
eventstreamEventstreamType

See also

Eventstream.funnel

Call Funnel tool as an eventstream method.

Notes

See Funnel user guide for the details.

fit(stages, stage_names=None, funnel_type='closed', segments=None, segment_names=None)[source]#

Calculate the funnel internal values with the defined parameters. Applying fit method is necessary for the following usage of any visualization or descriptive Funnel methods.

Parameters:
stageslist of str

List of events used as stages for the funnel. Absolute and relative number of users who reached specified events at least once will be plotted. Multiple events can be grouped together as an individual state by combining them as a sub list.

stage_nameslist of str, optional

List of stage names, this is necessary for stages that include several events.

funnel_type‘open’, ‘closed’ or ‘hybrid’, default ‘closed’
  • if open - all users will be counted on each stage;

  • if closed - each stage will include only users, that were present on all previous stages;

  • if hybrid - combination of 2 previous types. The first stage is required to go further. And for the second and subsequent stages it is important to have all previous stages in their path, but the order of these events is not taken into account.

segmentsCollection[Collection[int]], optional

List of user_ids collections. Funnel for each user_id collection will be plotted. If None - all users from the dataset will be plotted. A user can only belong to one segment at a time.

segment_nameslist of str, optional

Names of segments. Should be a list from unique values of the segment_col. If None and segment_col is given - all values from segment_col will be used.

plot()[source]#

Create a funnel plot based on the calculated funnel values. Should be used after fit().

Returns:
go.Figure
property params#

Returns the parameters used for the last fitting.

property values#

Returns a pd.DataFrame representing the calculated funnel values. Should be used after fit().

Returns:
pd.DataFrame

segment_name

stages

unique_users

%_of_initial

%_of_previous

segment_1

stage_1

2000

100.00

100.00

Eventstream#

Eventstream.funnel(stages, stage_names=None, funnel_type='closed', segments=None, segment_names=None, show_plot=True)[source]#

Show a visualization of the user sequential events represented as a funnel.

Parameters:
show_plotbool, default True

If True, a funnel visualization is shown.

See other parameters’ description

Funnel

Returns:
Funnel

A Funnel class instance fitted to the given parameters.