Skip to main content

next_best_action_train

Train a list of Markov models to predict the next best action in a customer journey.

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_nullstr None name 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
max_orderint3maximum Markov model order to be considered
nsim_startint1e5minimum number of simulations to be used in computation
max_stepintNonemaximum number of length for a single simulated path if None, it is the maximum length for a path belonging to Data
ncoreint1number of threads to be used in computation
nfoldint10how many repetitions to be used to verify if convergence has been reached at each iteration
seedint1234567random seed. Giving this parameter the same value over different runs guarantees that results will not vary
conv_pardouble0.05convergence 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.5number of simulations used at each iteration is equal to the number of simulations used at previous iteration multiplied by rate_step_sim
verboseboolTrueif True, additional information during the execution will be shown
serverstr"app.channelattribution.io"address of the server where password will be checked to authorize the execution of the function
passwordstrNoneuser

Output

OUTPUTTYPEDESCRIPTION
Paramslist of data.framesestimated conversion rates