Models

The open model hub has two main types of functions: map and aggregate.

  • map functions always return a series with the same shape and index as the DataFrame they are applied to. This ensures they can be added as a column to that DataFrame. map functions that return DataFrame can be used with to filter the data.
  • aggregate functions return aggregated data in some form from the DataFrame. Can also be accessed with agg.

Map

is_first_session(data)Labels all hits in a session True if that session is the first session of that user in the data.
is_new_user(data[, time_aggregation])Labels all hits True if the user is first seen in the period given time_aggregation.
is_conversion_event(data, name)Labels a hit True if it is a conversion event, all other hits are labeled False.
conversions_counter(data, name[, partition])Counts the total number of conversions given a partition (ie session_id or user_id).
conversions_in_time(data, name[, partition])Counts the number of time a user is converted at a moment in time given a partition (ie 'session_id' or 'user_id').
pre_conversion_hit_number(data, name[, ...])Returns a count backwards from the first conversion, given the partition.

Aggregate

unique_users(data[, groupby])Calculate the unique users in the Objectiv data.
unique_sessions(data[, groupby])Calculate the unique sessions in the Objectiv data.
session_duration(data[, groupby, ...])Calculate the duration of sessions.
frequency(data)Calculate a frequency table for the number of users by number of sessions.