View source: R/ChannelAttribution.R
choose_order | 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=1, roc_npt=100, plot=TRUE, flg_adv=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. |
roc_npt |
number of points used for approximating roc and auc. |
plot |
if TRUE, a plot with penalized auc with respect to order will be displayed. |
flg_adv |
if TRUE, ChannelAttribution Pro banner is printed. |
An object of class
List
with the estimated roc, auc and penalized auc.
Davide Altomare (info@channelattribution.io).
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.