Skip to content

Instantly share code, notes, and snippets.

@RedaAffane
Last active February 2, 2018 13:44
Show Gist options
  • Save RedaAffane/0c41ed9a93c5b715d02ca960aec8955b to your computer and use it in GitHub Desktop.
Save RedaAffane/0c41ed9a93c5b715d02ca960aec8955b to your computer and use it in GitHub Desktop.
# First, let's convert the dataframe "subsets_conversions" into a dictionnary
C_values = user_logs_aggr.set_index("channels").to_dict()["conversions"]
#For each possible combination of channels A, we compute the total number of conversions yielded by every subset of A.
# Example : if A = {c1,c2}, then v(A) = C({c1}) + C({c2}) + C({c1,c2})
v_values = {}
for A in subsets(channels):
v_values[A] = v_function(A,C_values)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment