Skip to main content

compare_models R Code

R


#Load library and data

library(ChannelAttributionPro)
library(data.table)

data(PathData)

password="yourpassword"

#Compare MTA models

res=compare_models(Data,var_path="path",var_conv="total_conversions",var_null="total_null",
cha_sep=">",perc_reall=0.1,perc_sample=0.10,max_nsim=10000,min_perc_traffic=0.005,
niter=30,flg_extra_path=1,max_markov_order=4,seed=1234567,verbose=1,
server="app.channelattribution.io",password=password)

boxplot(res$performance,main='Simulated Conversion Rate')

#Compare MTA models and Reward model (UAM)

df_paths=fread("https://app.channelattribution.io/data/data_paths_2.csv",sep=";")

df_ctr=fread("https://app.channelattribution.io/data/data_ctr_2.csv",sep=";")

res=compare_models(df_paths=df_paths,df_ctr=df_ctr,channel_conv_name="((CONV))",perc_reall=0.1,perc_sample=0.10,
max_nsim=10000,min_perc_traffic=0.005,niter=30,flg_extra_path=1,max_markov_order=4,seed=1234567,
verbose=1, server="app.channelattribution.io",password=password)

boxplot(res$performance,main='Simulated Conversion Rate')