View source: R/ClusterOptimization.r
fitMarkovChains | R Documentation |
The purpose of this function is to generate pre-computed markov chain objects from clusters of clickstreams.
fitMarkovChains(clusters, order = 1)
clusters |
The clusters from which to generate markov chain objects. |
order |
The order for the markov chain. |
Theo van Kraay theo.vankraay@hotmail.com
training <- c("User1,h,c,c,p,c,h,c,p,p,c,p,p,o",
"User2,i,c,i,c,c,c,d",
"User3,h,i,c,i,c,p,c,c,p,c,c,i,d",
"User4,c,c,p,c,d")
test <- c("User1,h,c,c,p,p,h,c,p,p,c,p,p,o",
"User2,i,c,i,c,c,c,d",
"User4,c,c,c,c,d")
trainingCLS <- as.clickstreams(training, header = TRUE)
testCLS <- as.clickstreams(test, header = TRUE)
clusters <- clusterClickstreams(trainingCLS, centers = 2)
markovchains <- fitMarkovChains(clusters, order = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.