Helper functions

Helper 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. Helper functions that return SeriesBoolean can be used to filter the data. The helper functions can be accessed with the map accessor from a model hub instance.

class modelhub.Map



Methods in this class can be used to map data in a DataFrame with Objectiv data to series values.

Always returns Series with same index as the DataFrame the method is applied to, so the result can be set as columns to that DataFrame.

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.