choose_order {ChannelAttribution} | R Documentation |
Find the minimum Markov Model order that gives a good representation of customers' behaviour for data considered. It requires paths that do not lead to conversion as input. Minimum order is found maximizing a penalized area under ROC curve.
choose_order(Data, var_path, var_conv, var_null, max_order=10, sep=">", ncore=Inf, roc_npt=100, plot=TRUE)
Data |
data.frame containing customer journeys. |
var_path |
column name of Data containing paths. |
var_conv |
column name of Data containing total conversions. |
var_null |
column name of Data containing total paths that do not lead to conversion. |
max_order |
maximum Markov Model order considered. |
sep |
separator between channels. |
ncore |
number of threads used in computation. Default is number of CPUs available. |
roc_npt |
number of points used for approximating roc and auc. |
plot |
if TRUE, a plot with penalized auc with respect to order is displayed. |
An object of class
List
with the estimated roc, auc and penalized auc.
Davide Altomare (davide.altomare@gmail.com).
## Not run: library(ChannelAttribution) data(PathData) res=choose_order(Data, var_path="path", var_conv="total_conversions", var_null="total_null") #plot auc and penalized auc plot(res$auc$order,res$auc$auc,type="l",xlab="order",ylab="pauc",main="AUC") lines(res$auc$order,res$auc$pauc,col="red") legend("right", legend=c("auc","penalized auc"), col=c("black","red"),lty=1) ## End(Not run)