R/Predict_next_page.R

#' Take some pageviews, output Markov model prediction
#'
#' @param current_URL A character vector of pageview names
#'
#' @return The prediction
#' @import clickstream
#' @export
PredictNextPage <- function (current_URL){
  startPattern <- new("Pattern", current_URL)
  out <- try(predict(model, startPattern), silent = TRUE)
  if(inherits(out,"try_error")){
    out <- "None"
  }
  out
}
happyidiots/AZpredict documentation built on Nov. 4, 2019, 1:27 p.m.