Hidden markov model to predict tourists visited place

Theo Demessance, Chongke Bi, Sonia Djebali, Guillaume Guérard

Abstract

Predicting tourist movements is a significant challenge for urban planning and tourism marketing. This paper presents a hybrid approach combining Grammatical Inference (GI) and Hidden Markov Models (HMMs) to model and predict tourist trajectories in Paris using social media data. By employing a "Relaxed Alergia" algorithm, the researchers efficiently compress complex visit sequences into a lean HMM. The model's predictive accuracy is further refined using the Baum-Welch algorithm, achieving a Mean Absolute Percent Error (MAPE) of approximately 9%. This structural approach proves particularly effective for the short sequences typical of tourist behavior.

Introduction

Predicting a tourist's next destination is a critical task for urban planners and tourism marketers. While social media platforms like TripAdvisor provide vast amounts of "digital traces" through geotagged reviews, transforming this noisy data into accurate predictive models remains difficult. Existing methods like deep learning often require massive datasets and struggle with the short sequences typical of tourist visits. Conversely, traditional data mining can lose temporal order or discard rare but significant behaviors. This research addresses these gaps by proposing a computationally efficient, structural model based on Grammatical Inference and Hidden Markov Models.

Methodology

The proposed pipeline consists of three main stages: data pre-processing, grammatical inference, and HMM transformation.

Data Pre-processing

Tourist "stays" are constructed by grouping reviews. A sequence is formed if a tourist posts reviews within a 7-day window. This temporal grouping helps define coherent trips from disparate digital traces, resulting in a filtered dataset of 11,471 sequences for the study.

Grammatical Inference: The Relaxed Alergia Algorithm

The core innovation is the use of a "Relaxed Alergia" algorithm to build a Frequency Prefix Tree (FPT). In an FPT, nodes represent visited locations and paths represent visit sequences. To manage model complexity, the algorithm merges nodes that exhibit statistically similar behavior.

Figure 2: The merging and folding operations of the Relaxed Alergia algorithm used to simplify the Frequency Prefix Tree.

Unlike standard Alergia algorithms, which are computationally expensive, the "Relaxed" version utilizes Hoeffding bounds to quickly identify compatible nodes. This process significantly reduces the number of states—in this case, from 599 nodes down to a lean HMM with just 37 nodes—while preserving essential behavioral patterns.

HMM Transformation and Prediction

The resulting stochastic automaton is converted into a Hidden Markov Model. The Viterbi algorithm is used for state estimation, and the Baum-Welch algorithm iteratively refines transition probabilities based on observed data, making the model flexible and editable as new trends emerge.

Results and Discussion

The model was validated using a dataset of TripAdvisor reviews for six major landmarks in Paris. The update process using the Baum-Welch algorithm proved crucial for accuracy.

Figure 4: Comparison of sequence probabilities and Mean Absolute Percent Error (MAPE) before and after the HMM update process.

As shown in Figure 4, the update process significantly improved the model's accuracy across various sequences. The initial HMM exhibited a MAPE of 20.8%, which dropped to approximately 8.9% for validation and 9.1% for future movement prediction. This reduction in error demonstrates the model's ability to learn and adapt to specific tourist movement patterns, providing a reliable tool for recommendation engines.

Conclusion

This research demonstrates that combining Grammatical Inference with Hidden Markov Models provides a robust framework for predicting tourist movements. The "Relaxed Alergia" algorithm offers a scalable way to handle big data by reducing model complexity without sacrificing predictive power. Future work will focus on increasing the granularity of locations and incorporating demographic metadata to enable personalized recommendations.

Summary updated

BibTeX
@inproceedings{demessance2021hidden,
  author = {Theo Demessance and Chongke Bi and Sonia Djebali and Guillaume Guérard},
  title = {{Hidden markov model to predict tourists visited place}},
  booktitle = {MDM},
  year = {2021},
  url = {https://openreview.net/forum?id=GoukzByF5f},
}
Figure