Skip to main content

markov_model_feat

Transaction-level attribution using Markov model with external features can be performed with function markov_model_feat.

Parameters

PARAMETERTYPEDEFAULTDESCRIPTION
Datadata.framedata.frame which includes columns: 'id_path' (id of the customer journey), 'channel_pos' (position of the channel in the customer journey), 'channel' and one column for each external feature considered
D_feat_typesdictdictionary which indicates the type of the feature: 'categorial' or 'numeric'
channel_convdict"((CONV))"how the conversion is indicated in column 'channel'
epsdouble0clustering algorithm: eps multiplied to the conversion rate of the data is the radius used in the clustering algorithm (DB scan). By default no clustering is performed.
num_pctint10clustering algorithm: number of percentiles used to discretize numeric variables
max_orderint10choosing Markov model order: maximum Markov model order to be considered
nfoldint10choosing Markov model order: number of fold in cross validation
perc_testdouble0.3choosing Markov model order: percentage of customer journeys that will be included in the test set of cross validation
seedint1234567random seed. Giving this parameter the same value over different runs guarantees that results will not vary
perc_toldouble0.01choosing Markov model order: percentage of tolerance for choosing the best Markov model order. If order o has an AUC(o) which is greater than (1-perc_tol) x AUC(o+1) then order o is consider better than o+1
nsim_startint1e5Markov model: minimum number of simulations to be used in computation
max_stepintNoneMarkov model: maximum number of length for a single simulated path
ncoreint1Markov model: number of threads to be used in computation
conv_pardouble0.05Markov model: convergence parameter for the algorithm. The estimation process ends when the percentage of variation of the results over different repetions is less than convergence parameter
rate_step_simdouble1.5Markov model: number of simulations used at each iteration is equal to the number of simulations used at previous iteration multiplied by rate_step_sim
serverstr"app.channelattribution.io"address of the server where password will be checked to authorize the execution of the function
passwordstrNoneuser

Output

OUTPUTTYPEDESCRIPTION
attributiondata.framepath-level attribution
weights_attrdata.frameestimated weights for each feature
weights_featdata.framecolumn 'auc_pre_rec' indicates the predictive performance of each feature (the area under the precision-recall curve built with a k-fold crossing validation) while column 'weight_feat' indicates the weight associated to each feature (weight of feature X = log(auc_pre_rec(X)/CR)/log(1/CR), where auc_pre_rec(X) is the area under the precision-recall curve of X and CR is the conversion rate of the Data)