mcEvaluateAll: Evaluates all next page clicks in a clickstream training data...

View source: R/Evaluation.r

mcEvaluateAllR Documentation

Evaluates all next page clicks in a clickstream training data set against a test data

Description

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.

Usage

mcEvaluateAll(
  mc,
  trainingCLS,
  testCLS,
  includeChiSquare = TRUE,
  returnChiSquareOnly = FALSE
)

Arguments

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?

Author(s)

Theo van Kraay theo.vankraay@hotmail.com

See Also

mcEvaluate

Examples

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)

clickstream documentation built on Sept. 27, 2023, 5:06 p.m.