Skip to main content

choose_order

ChannelAttribution Pro includes an out-of-sample algorithm for choosing the best Markov model order. First, the data are split into a train set and a test set. Using the train set a Markov model is estimated for each considered order. Each Markov model is used to predict the end state (conversion/no conversion) for each customer journey on the test set. For each Markov model, a ROC curve is defined and the area under the curve is calculated (AUC). The procedure is repeated on multiple test sets which are randomly chosen from the full data set (cross-validation procedure). For each order, an average AUC over all the test sets considered is calculated. The order with the maximum average AUC is finally chosen.

Best Markov model order in ChannelAttribution Pro can be choosen through choose_order function which incorporate the out-of-sample procedure procedure explained above.

Parameters

PARAMETERTYPEDEFAULTDESCRIPTION
Datadata.frame/strdata.frame or a file address where customer journeys are stored
var_pathstrname of the column containing paths
var_convstrname of the column containing total conversions
var_valuestrNonename of the column containing total conversion value
var_nullstrNonename of the column containing total paths that do not lead to conversion
row_sepstr","if Data is a file address then row _sep is the line separator
cha_sepstr">"separator between channels
roc_nptint100number of points in ROC
max_orderint10maximum Markov model order to be considered
nfoldint10how many repetitions to be used to verify if convergence has been reached at each iteration
perc_testdouble0.3percentage of customer journeys that will be included in the test set
seedint1234567random seed. Giving this parameter the same value over different runs guarantees that results will not vary
perc_toldouble0.01percentage of tolerance. 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
plotboolTrue if True, a plot with auc will be displayed
typestr"auc-roc"if "auc-roc", area under ROC curve will be calculated, if "auc-prerec" area under Precision-Recall curve will be calculated
serverstr"app.channelattribution.io"address of the server where password will be checked to authorize the execution of the function
passwordstrNoneuser

Output

OUTPUTTYPEDESCRIPTION
aucdata.frameAUC for each analyzed order
best_orderintbest order selected by the procedure