mcEvaluateAll | R Documentation |
Evaluates all next page clicks in a clickstream training data set against a test data. Handles higher order by cycling through every possible pattern permutation. Produces a report of observed and expected values in a matrix.
mcEvaluateAll(
mc,
trainingCLS,
testCLS,
includeChiSquare = TRUE,
returnChiSquareOnly = FALSE
)
mc |
A markovchain object that corresponds to a list of clusters. |
trainingCLS |
Clickstream object with training data (this should be the data used to build the markov chain object). |
testCLS |
Clickstream object with test data. |
includeChiSquare |
Should the result include the chi-square value? |
returnChiSquareOnly |
Should the result only consist of the chi-square value? |
Theo van Kraay theo.vankraay@hotmail.com
mcEvaluate
training <- c("User1,h,c,c,p,c,h,c,p,p,c,p,p",
"User2,i,c,i,c,c,c,d")
test <- c("User1,h,c,c,p,c,h,c,d,p,c,d,p",
"User2,i,c,i,p,c,c,d")
csf <- tempfile()
writeLines(training, csf)
trainingCLS <- readClickstreams(csf, header = TRUE)
unlink(csf)
csf <- tempfile()
writeLines(test, csf)
testCLS <- readClickstreams(csf, header = TRUE)
unlink(csf)
mc <- fitMarkovChain(trainingCLS, order = 2)
mcEvaluateAll(mc, trainingCLS, testCLS)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.