choose_order: Choose order for Markov model.

Description Usage Arguments Value Author(s) Examples

View source: R/ChannelAttribution.R

Description

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.

Usage

1
2
choose_order(Data, var_path, var_conv, var_null, max_order=10, sep=">", 
             ncore=1, roc_npt=100, plot=TRUE)

Arguments

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.

Value

An object of class List with the estimated roc, auc and penalized auc.

Author(s)

Davide Altomare (info@channelattribution.net).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
## 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)

ChannelAttribution documentation built on July 27, 2020, 9:06 a.m.