# Hybrid Movie Recommendation Based On Recent User Sequential Preferences and Sequential Profiles Using HMMs

J. Chiasseup Keudjeu, O. Kengni Ngangmo, Sylvain Iloga, T. Bouetou Bouetou

<figure><img src="image_1.png" /></figure>

► To cite this version:

J. Chiasseup Keudjeu, O. Kengni Ngangmo, Sylvain Iloga, T. Bouetou Bouetou. Hybrid Movie Recommendation Based On Recent User Sequential Preferences and Sequential Profiles Using HMMs. IEEE Access, 2025, 13, pp.192330 - 192357. 10.1109/access.2025.3630634. hal-05369633

HAL Id: hal-05369633

https://hal.science/hal-05369633v1

Submitted on 17 Nov 2025

HAL is a multi-disciplinary open access
archive for the deposit and dissemination of sci-
entific research documents, whether they are pub-
lished or not. The documents may come from
teaching and research institutions in France or
abroad, or from public or private research centers.

L'archive ouverte pluridisciplinaire HAL, est
destinée au dépôt et à la diffusion de documents
scientifiques de niveau recherche, publiés ou non,
émanant des établissements d'enseignement et de
recherche français ou étrangers, des laboratoires
publics ou privés.

<figure><img src="image_2.png" /></figure>

Distributed under a Creative Commons Attribution 4.0 International License
Received 29 September 2025, accepted 2 November 2025, date of publication 10 November 2025, date of current version 14 November 2025.

Digital Object Identifier 10.1109/ACCESS.2025.3630634

## RESEARCH ARTICLE

# Hybrid Movie Recommendation Based On Recent User Sequential Preferences and Sequential Profiles Using HMMs

J. CHIASSEUP KEUDJEU<sup>1</sup>, O. KENGNI NGANGMO<sup>2,3</sup>, SYLVAIN ILOGA<sup>3,4,5</sup>, AND T. BOUETOU BOUETOU<sup>1</sup>

Corresponding author: Sylvain Iloga (sylvain.iloga@gmail.com)

This work was supported by the Équipes Traitement de l'Information et Systèmes (ETIS) Unité Mixte de Recherche (UMR) 8051 Laboratory, CELL Team.

**ABSTRACT** Recommendation systems (RSs) are becoming more and more popular in many application areas. Therefore, the three following main categories of RSs have yet been designed: Content-Based, Collaborative Filtering and Hybrid Filtering. Unfortunately, none of the existing RSs take into account the sequential preferences and the sequential profiles of the system users which can, if considered, enable to make finer recommendations. To overcome this limitation, the current work proposes a Hybrid Filtering RS that uses Hidden Markov Models (HMMs) for chronologically learning the features of the recent sequence of movies watched by each user and the features of the recent sequence of users who watched each movie. Metadata derived from these HMMs are then used for representing each user and each movie as a numeric feature vector whose components are interpretable. The resulting vectors are finally combined for recommending movies to users. Several movie recommendation experiments realized on the open datasets Movielens-100K, Movielens-1M and Movielens-20M exhibited significantly better performances than those of the existing studies regarding the following metrics: precision, recall, F1 score, Root Mean Square Error (RMSE), Mean Absolute Error (MAE) and Normalized Discounted Cumulative Gain (NDCG).

**INDEX TERMS** Sequential movie recommendation, hybrid movie recommendation, hidden Markov models, user preferences, user profiles.

## I. INTRODUCTION

A Recommendation System (RS) is a powerful information tool providing personalized item recommendation to a user in a service environment that may contain or collect various data [1].<fnref n="1" /> These systems have become essential for many decades due to the difficulty of discovering the most suitable items for a given user, as the user's preferences change regularly depending on several factors (e.g., purchasing power, fashion, trends, culture, etc.) [2].<fnref n="2" /> They are consequently

The associate editor coordinating the review of this manuscript and approving it for publication was Yin Zhang<sup>1</sup>.

widespread in several domains including (but not limited to) e-commerce, social networks/media, streaming platforms, etc [1].<fnref n="3" /> In e-commerce, RSs are used by giant companies to facilitate online shopping due to their large number of customers and items. For instance, since 2024, more than 350 million items [3] from different countries have been offered to more than 300 million active users [4] around the world on the Amazon marketplace.

Streaming platforms also widely use RSs to offer a few videos/audios from large media databases that best match the preferences of their large number of customers.

<footnote n="1">¹Department of Computer Engineering, National Advanced School of Engineering, University of Yaoundé I, Yaoundé, Cameroon</footnote>

<footnote n="2">²Department of Information and Communication Technologies, Faculty of Sciences, University of Ebolowa, Ebolowa, Cameroon</footnote>

<footnote n="3">³IRD, UMMISCO, 93143 Bondy, France</footnote>

<footnote n="4">⁴Department of Computer Science, Higher Teachers' Training College, University of Maroua, Maroua, Cameroon</footnote>

<footnote n="5">⁵ETIS UMR 8051, CNRS, ENSEA, CY Cergy Paris University, 95000 Cergy, France</footnote>

<footnote n="1">¹See Section II-A of [1].</footnote>

<footnote n="2">²See the Introduction of [2].</footnote>

<footnote n="3">³See Section II-C and Figure 16 of [1].</footnote>
For example, Netflix managed a database containing more
than 18,000 films/series offered to more than 260 million
subscribers at the end of 2023 [5]. Another example is
the case of YouTube which generated more than 6 billion
views per month in 2023 for approximately 1.3 billion
unique users per month in 2023 [6]. In the same way,
RSs are ubiquitous on social networks/media to offer new
relationships/media potentially adapted to their high volume
of customers based on their profiles. This is the case in
Cameroon where Facebook users increased from 3.9 million
in January 2023 to 5.05 million in January 2024, representing
a growth of 1.15 million users in one year [7]. The current
work focuses on the use of RSs in streaming platforms.

RSs can be organized into two main categories: *Standard RSs* and *Sequential RSs*. The fundamental difference between these two categories lies in how they handle *user interactions*; these are user actions that indicate preferences or engagement with movies. User interactions can be explicit feedback such as ratings or likes/dislikes, or implicit feedback such as watching a movie, clicking on details, adding movies to a watchlist, or browsing the history. While standard RSs treat all user interactions in the system as an unordered set of user preferences, sequential RSs in contrast, aim to leverage ordered user interactions in order to predict the next movie a user is likely to engage with. They generally learn chronological sequences of user interactions that reflect the evolution of user preferences over time.

RSs in these two categories are generally designed
according to one of the three following main models [1]<fnref n="4" />:

1) **Collaborative Filtering (CF)** including standard RSs [8], [9], [10], [11], [12], [13], [14], [15] and sequential RSs [16], [17], [18], [19], [20], [21], [22], [23], [24].

2) **Content-Based Filtering (CBF)** including standard RSs [25], [26], [27] and sequential RSs [28], [29].

3) **Hybrid Filtering (HF)** including standard RSs [30], [31], [32], [33] and sequential RSs [34], [35].

In the rest of the current work, the acronyms CFRS,
CBFRS and HFRS will respectively refer to RSs based on
CF, CBF and HF. In addition to these three main models, few
authors have designed RSs according to different models that
are not yet widespread [14], [36], [37], [38].

CFRSs leverage existing registered user data (e.g., ratings, comments, reviews, etc.) linked to many items to make appropriate recommendations based on similarity between users, without requiring no exogenous information [39].<fnref n="5" /> CFRSs are organized into two main groups: *Memory-Based* and *Model-Based*. Memory-based algorithms rely on a rating matrix to identify users with similar tastes to a particular user *u*. The execution of these algorithms involves the calculation of similarity between users or between items. If the similarity is calculated between users, the algorithm is qualified as *user-based*, otherwise it is qualified as *item-based*.

Model-based algorithms rather analyze the rating matrix to
take into account patterns that define past user interactions
and behavior [40].<fnref n="6" /> CFRSs are mainly limited by the
problems of data sparsity and low scalability [41].<fnref n="7" /> The data
problem of sparsity refers to the difficulty that users mostly
rate only a small number of items which derives from a very
sparse user-item matrix [42].<fnref n="8" /> Scalability rather occurs when
the RS does not scale satisfactorily when the users and items
in the rating database increase [42].<fnref n="8" />

A good alternative to attenuate the limitations of CFRSs
is proposed by CBFRSs which rely on information about
available items, to recommend items with similar function-
ality to those preferred by users in the past [43].<fnref n="9" /> They
are unfortunately unable to capture inter-dependencies and
complex behaviors [44].<fnref n="10" />

HFRSs enable to find a compromise between the two
above-mentioned models. They attempt to alleviate the
limitations of one model, by the main assets of the other
model. Although the use of HFRSs most often leads to more
accurate and more effective recommendations than the use
of only one of the underlying RSs [44],<fnref n="11" /> they nevertheless
moderately inherit their main limitations, augmented by an
increase of the complexity of the implementation.<fnref n="12" />

An important common drawback of existing RSs in the
field of streaming platforms is the fact that they do not
take into account the sequential preferences, as well as the
sequential profiles of the users. They process the preferences
and the profiles of the users, without paying attention to
chronology. However, the chronological order in which a user
watches movies having various features (e.g., genre, release
date, vote average, vote count, etc.) may be a very informative
descriptor for that user. Indeed, a user who chronologically
watches two action movies, then two horror movies as
depicted in Figure 1a, has different sequential preferences
from another user who watches these same four movies
while changing the genre each time as shown in Figure 1b.
Similarly, the chronological order in which a movie is
watched by users having various features (e.g., age, gender,
occupation, address, etc.) can also be a relevant descriptor
for that movie. Indeed, the movie entitled 'THE JINX' that
will chronologically be watched by three male users then by
three female users as shown in Figure 2a, is different from
the movie entitled 'JORDAN' that will chronologically be
watched by these same users while changing the gender each
time as shown in Figure 2b.

The current work aims at attenuating this common
limitation of existing RSs for streaming platforms through
the proposal of a new HFRSs that uses Hidden Markov
Models (HMMs) for chronologically learning the features of

<footnote n="4">⁴See Figure 3 of [1].</footnote>

<footnote n="5">⁵See Section II of [39].</footnote>

<footnote n="6">⁶See Sections II-A and II-B of [40].</footnote>

<footnote n="7">⁷See the Introduction of [41].</footnote>

<footnote n="8">⁸See Section II of [42].</footnote>

<footnote n="9">⁹See Section Introduction of [43].</footnote>

<footnote n="10">¹⁰See Section II-B of [44].</footnote>

<footnote n="11">¹¹See Section II-C of [44].</footnote>

<footnote n="12">¹²See Table 2 of [44].</footnote>
<figure><img src="image_3.png" /><figcaption>FIGURE 1. Two users who watched the same movies in different chronological orders of genres.</figcaption></figure>

<figure><img src="image_4.png" /><figcaption>FIGURE 2. Two movies watched by the same users in different chronological orders of genders.</figcaption></figure>

the recent sequence of movies watched by each user, and the features of the recent sequence of users who watched each movie. Meta-data derived from these HMMs are then used for representing each user and each movie as a numeric feature vector. The resulting vectors are finally combined for recommending movies. The performances of the proposed technique are evaluated on three open movie datasets from the Kaggle repository.<fnref n="13" />

The rest of this work is organized as follows: the state of the art is presented in Section II, followed by a synthetic description of HMMs in Section III. The proposed approach is described in Section IV, while the experimental results are presented in Section V. The last section is devoted to the conclusion.

## II. STATE OF THE ART

Several techniques have been used to design existing standard and sequential RSs according to the three main models (CFRSs, CBFRSs and HFRSs). Beside this, few authors have designed RSs according to other models including: demographic-based, utility-based, knowledge-based, context-aware and review-based. The current section reviews relevant related studies designed by the three main models, as well as those designed by the other models.

### A. STANDARD SYSTEMS

Consider a large user-movie rating matrix $R$ such that $R_{ij}$ represents the rating given by the $i^{th}$ user to the $j^{th}$ movie.

Matrix factorization techniques [9], [12], [13], [14], [15], [27], [31], [33] enable to identify hidden linear patterns in user-movie interactions by decomposing the matrix ($R \approx U \times M^t$) as the product of two smaller matrices where $U$ is the user matrix that captures the user preferences, and $M$ is the movie matrix that captures movie features, $M^t$ being the transpose of $M$. The goal is to find the matrices $U$ and $M$ that minimize the difference between the actual ratings in $R$ and the predicted ratings in $U \times M^t$. This minimization can be realized through various mathematical techniques including Markovian [9], probabilistic [27] or weighted [31] factorization. Singular Value Decomposition [14] is also a type of matrix factorization that uses linear algebra to factorize $R$. Matrix factorization techniques are suitable for sparse data where users only rate few movies but require a high computation time for very large datasets.

Deep learning techniques [8], [10], [11], [25] are more flexible than matrix factorization techniques because they can additionally learn non linear patterns from multiple inputs including user features, movie features and contextual information (e.g., clicks, watch time, skips, search queries, etc.) in order to predict a rating or a probability that a user will like a movie. Autoencoders, Transformers and Recurrent Neural Networks (RNNs) are among the most popular types of deep models used for this purpose. These models remain efficient for large-scale data, but they require lots of computing resources and their hyper-parameters are difficult to adjust.

Co-clustering techniques [45] simultaneously cluster users and movies into groups to identify latent patterns and improve

<footnote n="13">¹³https://www.kaggle.com/datasets</footnote>
<table><caption>TABLE 1. Performances of some relevant existing RSs belonging to the three main movie recommendation models and experimented on various versions of the *Movielens-*@ dataset. The column '@' precises the version of the dataset.</caption><thead><tr><th>Models</th><th>Authors[Ref]</th><th>Years</th><th>Techniques</th><th>@</th><th>Performance</th><th>Drawbacks</th></tr></thead><tbody><tr><td rowspan="15">Collaborative filtering</td><td>Kang & McAuley [19]</td><td>2018</td><td>SASRec</td><td>1M</td><td>NDCG: 0.5905</td><td></td></tr><tr><td>Tang, Wang & Liu [21]</td><td>2018</td><td>Caser</td><td>1M</td><td>Precision: 0.1991<br>Recall: 0.1121</td><td></td></tr><tr><td>Harald Steck [8]</td><td>2019</td><td>Deep learning</td><td>1M <sup>14</sup></td><td>Precision: 0.216<br>Recall: 0.289<br>F1: 0.206<br>NDCG: 0.335</td><td></td></tr><tr><td>Zhang & Mao [9] <sup>15</sup></td><td>2019</td><td>Markovian matrix<br>factorization</td><td>1M<br>20M</td><td>Precision: 0.73<br>RMSE: 0.90<br>Precision: 0.33<br>RMSE: 0.88</td><td></td></tr><tr><td>Mohammed F. et al. [10]</td><td>2020</td><td>Deep learning</td><td>100K</td><td>RMSE: 0.917</td><td></td></tr><tr><td>Mohammed F. et al. [11]</td><td>2020</td><td>Deep learning</td><td>1M<br>100K<br>1M</td><td>RMSE: 0.903<br>RMSE: 0.931<br>RMSE: 0.881</td><td></td></tr><tr><td>Barathy et al. [12]</td><td>2020</td><td>Matrix factorization</td><td>100K</td><td>RMSE: 0.9646<br>MAE: 0.9490</td><td>- Data sparsity<br>- Low scalability</td></tr><tr><td>Maaruf & Zhihong [13]</td><td>2020</td><td>Matrix factorization</td><td>100K</td><td>MAE: 0.712<br>Precision: 0.7682</td><td></td></tr><tr><td>Anwar & Uma [14]</td><td>2021</td><td>Singular Value<br>Decomposition</td><td>100K</td><td>RMSE: 0.9202<br>MAE: 0.7219</td><td></td></tr><tr><td>Sonu & Agrawal [45]</td><td>2023</td><td>Co-Clustering</td><td>100K<br>1M</td><td>RMSE: 0.9537<br>MAE: 0.746<br>RMSE: 0.9064<br>MAE: 0.7102</td><td></td></tr><tr><td>Behera & Nain [15]</td><td>2023</td><td>Temporal<br>matrix factorization</td><td>100K<br>1M</td><td>RMSE: 0.9119<br>MAE: 0.7084<br>RMSE: 0.8528<br>MAE: 0.6683</td><td></td></tr><tr><td>Petrov & Macdonald [24]</td><td>2024</td><td>RSS + GRU4Rec,<br>Caser, SASRec</td><td>20M</td><td>Recall: 0.188<br>NDCG: 0.1968</td><td></td></tr><tr><td rowspan="4">Content-based<br>filtering</td><td>Chen et al. [25]</td><td>2017</td><td>Deep learning</td><td>20M</td><td>Precision: 0.0798</td><td rowspan="4">Unable to capture<br>inter-dependencies<br>and complex<br>behaviors</td></tr><tr><td>J. Son & Seoung [26] <sup>16</sup></td><td>2017</td><td>Multiattribute<br>networks</td><td>1M</td><td>Precision: 0.73<br>Recall: 0.1</td></tr><tr><td>Chen et al. [27]</td><td>2018</td><td>Probabilistic matrix<br>factorization</td><td>2011</td><td>RMSE: 0.740569</td></tr><tr><td>Sun et al. [28]</td><td>2019</td><td>Bidirectional<br>SASRec</td><td>1M<br>20M</td><td>NDCG: 0.4818<br>NDCG: 0.5340</td></tr><tr><td rowspan="5">Hybrid<br>filtering</td><td>Lekakos & Caravelas [30]</td><td>2008</td><td>Hybrid switching<br>and substitute</td><td>1M</td><td>MAE: 0.7501</td><td rowspan="5">Increased<br>complexity<br>of the<br>implementation</td></tr><tr><td>Badaro & Wassim [31]</td><td>2013</td><td>Weighted matrix<br>factorization</td><td>100K</td><td>MAE: 0.6</td></tr><tr><td>Xue et al. [34]</td><td>2017</td><td>Temporal<br>Matrix factorization</td><td>100K<br>1M</td><td>NDCG: 0.409<br>NDCG: 0.451</td></tr><tr><td>Yashar D. et al. [32]</td><td>2018</td><td>KNN</td><td>20M</td><td>Recall:0.0067<br>MAE: 0.7198<br>Precision: 0.8704<br>Recall: 0.1067</td></tr><tr><td>Valdiviezo & Bobadilla [33]</td><td>2019</td><td>Matrix factorization</td><td>100K</td><td>Recall: 0.188<br>NDCG: 0.1968</td></tr></tbody></table>

recommendations, but they can struggle with scalability and sparsity in large datasets.

*Multiattribute networks* [26] model relationships between multiple attribute (e.g., genre, actors, directors, etc.) using graph-based representations where vertices are entities (e.g., movies, users, genres, etc.) and edges capture their interactions, enabling more nuanced recommendations. But they can become computationally expensive and complex to maintain, especially with large and evolving datasets.

*Hybrid switching* techniques [30] alternate between different recommendation methods (e.g., CBF and CF) based on context or performance. But this may lead to inconsistent user experiences if switching is not well-optimized. *Hybrid substitute* techniques [30] replace one recommendation method with another when the primary method fails or lacks sufficient data. But this might introduce suboptimal

recommendations if the substitute method is not well-matched to the context.

*KNN*-based movie RSs [32] find similar users or movies by computing distances (e.g., cosine similarity) in a feature space and recommend movies based on the preferences of the nearest neighbors. But these RSs suffer from high computational cost, poor scalability with large datasets and sensitivity to sparsity in user-movie interactions.

Other authors proposed interesting CFRSs [46], [47], CBFRSs [27], [48], [49], [50] and HFRSs [51], [52], [53]. But these studies are not reviewed in the current paper because some experimental datasets and performances are missing.

<footnote n="14"><sup>14</sup>These performances are available in Table 4 of [54].</footnote>

<footnote n="15"><sup>15</sup>Tests realized on only 20% of each dataset (See Section IV-B of [9]).</footnote>

<footnote n="16"><sup>16</sup>Tests realized on only 50 movies (See Section IV-B of [26]).</footnote>
## B. SEQUENTIAL SYSTEMS

Sequential RSs are designed using several techniques including: *Self-Attentive Sequential Recommendation* (SAS-Rec) [19], [28], [35], *Gated Recurrent Unit for Recommendation* (GRU4Rec) [17], [18], [20], *Convolutional Sequence Embedding Recommendation* (Caser) [21], [29], *Session-based Recommendation* [22], [23] and *Temporal Matrix Factorization* [16], [34].

SASRec is a Transformer-based model that computes attention weights over all past interactions with positional encodings, allowing the model to flexibly focus on relevant items from any point in the user's history. It allows full parallelization during training which is advantageous for scalability, but is computationally expensive for very long sequences.

GRU4Rec uses RNNs with Gated Recurrent Units (GRUs) to process sequences one step at a time. The hidden state of the GRU evolves as new interactions are observed, naturally encoding sequentiality by storing a summary of all past interactions up to the current step. It offers strong order-awareness, but suffers from slower training and difficulty in capturing very long dependencies.

Caser uses Convolutional Neural Networks (CNNs) to represent a user's recent interaction history as a fixed-size embedding matrix, and then applies horizontal and vertical convolutional filters to capture local sequential patterns and user-movie preferences within that window. It therefore excels at modeling local sequential patterns, but is also limited in capturing very long-range dependencies. In 2024, Petrov and Macdonald proposed a novel *Recency-based Sampling of Sequences* (RSS) training objective that enhances the performances of GRU4Rec, Caser, and SASRec when used as backbone models [24].

Session-based recommenders focus on modeling user behavior by capturing transitions between movies within short-term sessions using models like RNNs, Graph Neural Networks (GNNs), or attention mechanisms. They are thus well-suited for anonymous or ephemeral user scenarios, but they ignore long-term user preferences.

Temporal Matrix Factorization extends classical Matrix Factorization by allowing user factors to evolve over time, capturing gradual preference changes without explicitly modeling the strict order of individual interactions. It relies on linear algebra and optimization techniques rather than deep neural networks like most existing sequential techniques. The underlying RSs are scalable, shallow, and interpretable, but are unable to model complex sequential data.

## C. OTHER MODELS

*Demographic-based* RSs are based on user profile information such as age, gender, demographic area (location), education, and interests. For this model, users belonging to the same demographic have similar preferences [36].<fnref n="17" /> In *utility-based* RSs, recommendations are generated by

producing a model of each item's utility to the user. The system constructs several features of users' utility functions and recommends the highest utility item [37].<fnref n="18" /> *Knowledge-based* RSs use their knowledge about users and items to make recommendations [14].<fnref n="19" /> Considering the fact that the preferences of a user can change depending on some contextual factors (mood, season, time of day, location, companion, occasion, etc.), *context-aware* RSs have been introduced to make better recommendations using peculiar contextual conditions [38].<fnref n="20" /> Finally, *review-based* RSs use opinion mining and text analysis techniques to review product and user profiles in order to make good recommendations [14].<fnref n="21" /> More detailed overviews related to the design of RSs can be found in [1], [37], [55], and [56].

Table 1 summarizes the performances of relevant existing standard and sequential RSs that rely on the three main models reviewed in the current work, alongside with their drawbacks. Only the performances of the related studies that carried out experiments on the following versions of the widespread *Movielens-*@ datasets from the *Kaggle* repository¹³ were reported in that table: *Movielens-100K*, *Movielens-1M*, *Movielens-20M* and *Movielens-2011*. The performances of the RSs presented in Table 1 are evaluated according to several popular accuracy metrics including the *Root Mean Square Error* (RMSE), the *Mean Absolute Error* (MAE), the *Precision*, the *Recall*, the *F1-score*, the *Normalized Discounted Cumulative Gain* (NDCG), etc. A detailed presentation of these accuracy metrics is available in Section V-D. Various beyond-accuracy metrics related to various aspects (novelty, fairness, popularity bias, etc.) and listed in [54]<fnref n="22" /> have also been used for evaluating the performances of existing RSs. This was the case in [57] where user-item matching is performed to improve the recommendation fairness. These metrics have also been used by many other studies reviewed in [54].<fnref n="23" />

## D. PROBLEM STATEMENT

The main drawback of the standard and sequential existing techniques for the design of RSs that is tackled by the current work is the fact that they do not take into account both the sequential preferences and the sequential profiles of the users which can, if considered, enable to make finer recommendations. The current work attempts to overcome this limitation by considering the chronology through the proposal of a HFRS that uses HMMs for learning the features of the recent sequence of movies watched by each user, and the features of the recent sequence of users who watched each movie in order to represent each user and each movie as a numeric feature vector. An analysis of the neighborhood of the resulting feature vectors with the KNN algorithm

<footnote n="18">¹⁸See Section II-D of [37].</footnote>

<footnote n="19">¹⁹See Section II-C of [14].</footnote>

<footnote n="20">²⁰See the Introduction of [38].</footnote>

<footnote n="21">²¹See Figure 5 of [14].</footnote>

<footnote n="22">²²See Table 3 of [54].</footnote>

<footnote n="23">²³See Section III-B and Table 9 of [54].</footnote>

<footnote n="17">¹⁷See Section 1.3 of [36].</footnote>
<figure><img src="image_5.png" /><figcaption>FIGURE 3. HMM used as sequence generator.</figcaption></figure>

enables to make the movie recommendations. HMMs are preferred here because they are suitable for managing sequential data and also because they are manipulated by robust well-known algorithms whose efficiency no longer needs to be demonstrated.

### III. PRESENTATION OF HMMs

#### A. DEFINITION OF A HMM

A HMM $\lambda=(A, B, \pi)$ is fully characterized by [58]$^{24}$:

1) Its number $N$ of states, the set of states being $S = \{s_1, \dots, s_N\}$. The state of the model at time $t$ is generally noted $q_t \in S$.

2) Its number $M$ of symbols, the set of symbols being $\mathcal{V} = \{z_1, \dots, z_M\}$. The symbol observed at time $t$ is generally noted $o_t \in \mathcal{V}$.

3) Its state transition probability matrix $A$ verifying $A[s_i, s_j] = \text{Prob}(q_{t+1} = s_j|q_t = s_i)$ with $1 \le i, j \le N$.

4) Its symbols observation probability matrix $B$ verifying $B[s_i, z_k] = \text{Prob}(z_k \text{ at time } t|q_t = s_i)$ with $1 \le i \le N$ and $1 \le k \le M$.

5) Its initial state probability vector $\pi$ verifying $\pi[s_i] = \text{Prob}(q_1 = s_i)$ with $1 \le i \le N$.

#### B. GENERATION OF SEQUENCE

A HMM $\lambda = (A, B, \pi)$ can be used for generating a sequence $O = o_1 \dots o_T$ composed of $T$ symbols observed following the sequence of states $q = q_1 \dots q_T$ as described in the *Markov chain* (MC) shown in Figure 3. In order to obtain this MC, the following algorithm is executed:

1) Select the initial state $s_j$ according to $\pi$ and set $t = 0$.

2) Set $t = t + 1$ and change the current state to $q_t = s_j$.

3) Select the symbol $o_t \in \mathcal{V}$ to be observed at state $q_t$ according to $B$.

4) If $(t < T)$ go to step 5, else **terminate**.

5) Select the state transition to be realized from the current state $q_t$ to another state $s_j \in S$ according to $A$, then **go to** step 2.

#### C. MANIPULATION OF A HMM

Consider a sequence of symbols $O = o_1 \dots o_T$ and a HMM $\lambda = (A, B, \pi)$. The probability $\text{Prob}(O|\lambda)$ to observe $O$ given $\lambda$ is efficiently calculated by the *Forward-Backward* algorithm [58]$^{25}$ that runs in $O(T \cdot N^2)$. Given a sequence of symbols $O = o_1 \dots o_T$, it is possible to iteratively re-estimate the parameters of a HMM $\lambda = (A, B, \pi)$ in order to maximize

the value of $\text{Prob}(O|\lambda)$, where $\lambda = (\bar{A}, \bar{B}, \bar{\pi})$ is the re-estimated model. The *Baum-Welch* algorithm [58]$^{26}$ is used for this purpose. This algorithm runs in $O(\gamma \cdot T \cdot N^2)$ where $\gamma$ is the user-defined maximum number of iterations.

#### D. STATIONARY DISTRIBUTION

A vector $\varphi = (\varphi[s_1], \dots, \varphi[s_N])$ is a stationary distribution of a HMM $\lambda = (A, B, \pi)$ if [59]$^{27}$:

1) $\forall j, \varphi[s_j] \ge 0 \text{ and } \sum_j \varphi[s_j] = 1$

2) $\varphi = \varphi.A \Leftrightarrow (\varphi[s_j] = \sum_i \varphi[s_i] \times A[s_i, s_j], \forall j)$

$\varphi[s_j]$ estimates the overall proportion of time spent by $\lambda$ in state $s_j$ after a sufficiently long time. $\varphi$ can be extracted as any line of the matrix $A^r = A \times A \times \dots \times A$ (r times) when $r \to +\infty$. The computation of $\varphi$ requires $O(r \cdot N^3)$ arithmetic operations.

### IV. THE PROPOSED APPROACH

#### A. MAIN IDEA FOR THE CBF

The CBF sub-system proposed in the current work is motivated by the main idea that any user of a RS can be well characterized by its sequential preferences. These sequential preferences can be used as support for categorizing the users and they can consequently serve as inputs for performing a finer recommendation.

To achieve this goal, given a user $u$ who watches in this order the sequence $X = x_1 x_2 \dots x_T$ of movies, and a finite set $F = \{f_1, f_2, \dots, f_k\}$ of selected movie features, a HMM $\lambda_i^u(X)$ is trained to capture the sequential preferences of the user $u$ from the content of $X$, according to each movie feature $f_i \in F$, with $(1 \le i \le k)$. Meta-data extracted from $\lambda_i^u(X)$ are saved as the components of a single descriptor vector $\vec{u}_i$, associated with $u$, according to the feature $f_i$. The user $u$ is subsequently represented by a unique descriptor vector $\vec{u}_F$ derived from the concatenation of all the vectors $\vec{u}_i$, with $(1 \le i \le k)$. Once each user of the system is transformed into one unique numeric descriptor vector according to this process, the resulting user vectors will be combined to the movie vectors calculated by the CF sub-system for making the movie recommendations.

Given that the sequential preferences of a user $u$ most often change within the time, it is preferable to only capture the *most recent sequential preferences* of $u$ by considering the sequence $X$ containing at most the last $T_{max}$ movies watched by $u$ as the relevant movies, where $T_{max}$ is a user-defined positive constant whose value cannot exceed the number of movies in the system.

#### B. MAIN IDEA FOR THE CF

The CF sub-system proposed here is motivated by the main idea that any movie of a RS can be well characterized by the sequential profiles of its chronological viewers. These sequential profiles can serve as support for categorizing the movies in order to make a finer recommendation.

<footnote>$^{24}$See Section II-B of [58].</footnote>

<footnote>$^{25}$See Section III-A of [58].</footnote>

<footnote>$^{26}$See Section III-C of [58].</footnote>

<footnote>$^{27}$See Definition 9.1 of [59].</footnote>
<figure><img src="image_6.png" /><figcaption>**FIGURE 4.** Single vector $\vec{u}_i$ associated with $u$ according to the feature $f_i$. For the CBF sub-system, $u$ is a user, $f_i$ is a movie feature and $X$ is a sequence of movies. For the CF sub-system, $u$ is a movie, $f_i$ is a user feature and $X$ is a sequence of users.</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>**FIGURE 5.** Final descriptor vector $\vec{u}_F$ associated with $u$ according to the set $F = \{f_1, \dots, f_k\}$. For the CBF sub-system, $u$ is a user, $\{f_1, \dots, f_k\}$ are movie features and $X$ is a sequence of movies. For the CF sub-system, $u$ is a movie, $\{f_1, \dots, f_k\}$ are user features and $X$ is a sequence of users.</figcaption></figure>

In this context, if $u$ is now considered as a movie that is watched in this order by the sequence $X = x_1x_2 \dots x_T$ of users, and if $F = \{f_1, f_2, \dots, f_k\}$ is now considered as a finite set of selected user features, then the movie $u$ will be represented by a unique numeric descriptor vector $\vec{u}_F$ analogically to what was specified for the proposed CBF sub-system in Section IV-A. The main difference between these two proposed sub-systems is that in the CBF sub-system, each user is initially considered as a sequence of movies, but in the CF sub-system, each movie is initially considered as a sequence of users. Both sub-systems finally generate numeric descriptor vectors.

Given that the sequential profiles of the viewers of a movie $u$ generally change within the time, it is also preferable to only capture the *most recent sequential profiles* of the viewers of $u$ by considering the sequence $X$ containing at most the last $\bar{T}_{max}$ viewers of $u$ as the relevant users, where $\bar{T}_{max}$ is a user-defined positive constant whose value cannot exceed the number of system users.

## C. METHODOLOGY

Consider that a user $u$ watches in this order the sequence $X = x_1x_2 \dots x_T$ of movies and attributes the score (rate) $\alpha^u(x_j)$ to each movie $x_j \in X$, with $(1 \le j \le T)$. The methodology proposed in the CBF sub-system for deriving the feature vector $\vec{u}_F$ associated with the user $u$ according to the finite set $F = \{f_1, f_2, \dots, f_k\}$ of movie features is composed of the four following main steps:

1. **MC generation:** For each movie feature $f_i \in F$ with $(1 \le i \le k)$, the Markov chain $\delta_i^u(X)$ is constructed to capture the sequence of values (user preferences) taken by the feature $f_i$ for the movies in $X$, alongside with the corresponding scores.

2. **HMM initialization and training:** A HMM $\lambda_i^u(X)$ is initialized and trained using the Baum-Welch algorithm [58]²⁶ for learning the sequential preferences of the user $u$ captured in the Markov chain $\delta_i^u(X)$.

3. **Meta-data extraction:** Meta-data extracted from $\lambda_i^u(X)$ are later used to derive the single feature vector $\vec{u}_i$ associated with the user $u$ according to the feature $f_i$ as described in Figure 4.

4. **Final vector computation:** Finally, a unique feature vector $\vec{u}_F$ is constructed by concatenating all the feature vectors $\vec{u}_i$, with $(1 \le i \le k)$ as shown in Figure 5.

Figures 4 and 5 also describe the methodology of the CF sub-system if $u$ is now considered as a movie that is watched in this order by the sequence $X = x_1x_2 \dots x_T$ of users and that $F = \{f_1, f_2, \dots, f_k\}$ is now a finite set of selected user features. Thus, the CBF and the CF sub-systems both follow the four steps of the aforementioned methodology to derive descriptor vectors. Only the step of MC generation differs from one sub-system to the other because in the CBF sub-system, $F$ contains movie features, while in the CF sub-system it contains user features.
<table><caption>TABLE 2. Movies features, scores and timestamps *t* of the movies *x*₁ to *x*₇ watched by the users *u*, *v* and *w*.</caption><thead><tr><th>x<sub>i</sub></th><th>f<sub>1</sub><br>Release<br>date</th><th>f<sub>2</sub><br>Vote<br>average</th><th>f<sub>3</sub><br>Vote<br>count</th><th>f<sub>4</sub><br>Genres</th><th>(&alpha;<sup>u</sup>(x<sub>i</sub>), t)</th><th>(&alpha;<sup>v</sup>(x<sub>i</sub>), t)</th><th>(&alpha;<sup>w</sup>(x<sub>i</sub>), t)</th></tr></thead><tbody><tr><td>x<sub>1</sub></td><td>2008</td><td>2.3</td><td>189</td><td>{g<sub>1</sub>, g<sub>7</sub>}</td><td>(2.5, 1025)</td><td>(4.0, 1175)</td><td>(4.5, 1380)</td></tr><tr><td>x<sub>2</sub></td><td>2014</td><td>1.2</td><td>82</td><td>{g<sub>2</sub>}</td><td>(3.5, 1069)</td><td>(3.0, 1158)</td><td>-</td></tr><tr><td>x<sub>3</sub></td><td>2019</td><td>4.1</td><td>223</td><td>{g<sub>1</sub>, g<sub>3</sub>, g<sub>9</sub>}</td><td>(3.0, 1131)</td><td>(2.0, 1042)</td><td>(3.0, 1107)</td></tr><tr><td>x<sub>4</sub></td><td>2023</td><td>1.8</td><td>117</td><td>{g<sub>8</sub>, g<sub>10</sub>}</td><td>(1.5, 1275)</td><td>(3.0, 1250)</td><td>(3.5, 1054)</td></tr><tr><td>x<sub>5</sub></td><td>2011</td><td>3.7</td><td>142</td><td>{g<sub>2</sub>, g<sub>6</sub>}</td><td>-</td><td>(3.5, 1077)</td><td>(1.5, 1210)</td></tr><tr><td>x<sub>6</sub></td><td>2020</td><td>1.1</td><td>91</td><td>{g<sub>1</sub>, g<sub>3</sub>, g<sub>5</sub>}</td><td>-</td><td>(1.0, 1085)</td><td>-</td></tr><tr><td>x<sub>7</sub></td><td>2013</td><td>2.6</td><td>168</td><td>{g<sub>3</sub>, g<sub>4</sub>, g<sub>6</sub>, g<sub>7</sub>}</td><td>-</td><td>(2.5, 1193)</td><td>(3.0, 1102)</td></tr></tbody></table>

<figure><img src="image_8.png" /><figcaption>FIGURE 6. Pseudo MC $\bar{\delta}_i^u(X)$ associated with a user *u* who watched a sequence *X* of movies.</figcaption></figure>

1) MC GENERATION FOR THE CBF

As it can be observed in Figure 3, a Markov chain is composed of states and symbols, both from finite sets. In the proposed CBF sub-system, the scores attributed to the movies by the users are considered as the states, and the values taken by the movie features are considered as the symbols. More formally, in order to capture the sequential preferences of a user *u*, who watches in this order the sequence $X = x_1x_2...x_T$ of movies according to the movie feature $f_i \in F$, the movies in *X* are chronologically browsed from $x_1$ to $x_T$. At each step *j* with $(1 \le j \le T)$ where the current movie $x_j$ is processed, the value $f_i(x_j)$ taken by the movie feature $f_i$ for the current movie is observed, from a state represented here by the score $\alpha^u(x_j)$ attributed by *u* to the current movie. When this process is applied, the pseudo Markov chain $\bar{\delta}_i^u(X)$ is obtained as depicted in Figure 6. As an example, suppose that $F=\{f_1, ..., f_4\}^{28}$ where:

1) $f_1$ is the *release date* limited here to the year when the movie was released.

2) $f_2$ is the *vote average*, which is the average of the scores attributed by the users who watched the movie.

3) $f_3$ is the *vote count*, which refers to the number of users who watched the movie.

4) $f_4$ is the *genre* of the movie considered here as a subset of $\{g_1, ..., g_{10}\}$.

Consider for example a system containing 1000 movies, including the movies $x_1$ to $x_7$ whose features are presented in the columns 2 to 5 of Table 2. Suppose that the system manages 936 users such that the users *u*, *v* and *w* are the *most recent viewers* of the movies $x_1$ to $x_7$ in the system. These three users watched no other movie than those contained in Table 2 and the scores they attributed to these movies are contained in the three last columns of that same table, alongside with the corresponding timestamps *t*. According to these timestamps, the users *u*, *v* and *w* respectively

<figure><img src="image_9.png" /></figure>

<figure><img src="image_10.png" /></figure>

<figure><img src="image_11.png" /></figure>

<figure><img src="image_12.png" /><figcaption>FIGURE 7. Pseudo MCs of the user *u* who watched the sequence $X = x_1x_2x_3x_4$ of movies.</figcaption></figure>

watched in this order the sequences $X = x_1x_2x_3x_4$, $Y = x_3x_5x_6x_2x_1x_7x_4$ and $Z = x_4x_7x_3x_5x_1$ of movies. If it is assumed that ($T_{max}$ = 7), this enables to obtain the pseudo MCs presented in Figures 7a to 7d for the user *u*. The pseudo MCs associated with *v* and *w* are not presented here for space constraints. The following problems arise from Figures 7a to 7d:

1) The states (scores) and all the symbols (movie features) do not belong to finite sets.

2) Some movie features like the movie genre can have multiple values from the same movie.

The first problem can be solved through a user-defined sampling of the corresponding infinite set in order to obtain a finite set composed of *n* samples. The content of Table 3 is an example of possible user-defined sampling<sup>29</sup> which converts the scores into five symbols from {1, ..., 5}, the release dates, the vote average and the vote counts being all converted into ten symbols from {1, ..., 10}.

The problem of movie features that can have multiple values like the genre can be solved by clustering its possible values according to their frequencies in the dataset as follows:

<footnote n="28"><sup>28</sup>These movie features are available in *Movielens-100K*.</footnote>

<footnote n="29"><sup>29</sup>This sampling is guided by the content of *Movielens-100K*.</footnote>
<table><caption>TABLE 3. Samplings for the scores and for some movie features.</caption><thead><tr><th>Symbol</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th></tr></thead><tbody><tr><td>Score</td><td>[0, 1.0]</td><td>[1.0, 2.0]</td><td>[2.0, 3.0]</td><td>[3.0, 4.0]</td><td>&gt; 4.0</td></tr><tr><td>Release date</td><td>&le;1979</td><td>[1980, 1985]</td><td>[1986, 1990]</td><td>[1991, 1995]</td><td>[1996, 2000]</td></tr><tr><td>Vote average</td><td>[0, 0.5]</td><td>[0.5, 1.0]</td><td>[1.0, 1.5]</td><td>[1.5, 2.0]</td><td>[2.0, 2.5]</td></tr><tr><td>Vote count</td><td>[0, 25]</td><td>[26, 50]</td><td>[51, 75]</td><td>[76, 100]</td><td>[101, 125]</td></tr></tbody></table>

<table><caption>TABLE 4. Examples of genre frequencies.</caption><thead><tr><th>Symbol</th><th>6</th><th>7</th><th>8</th><th>9</th><th>10</th></tr></thead><tbody><tr><td>Release date</td><td>[2001, 2005]</td><td>[2006, 2010]</td><td>[2011, 2015]</td><td>[2016, 2020]</td><td>&ge;2021</td></tr><tr><td>Vote average</td><td>[2.5, 3.0]</td><td>[3.0, 3.5]</td><td>[3.5, 4.0]</td><td>[4.0, 4.5]</td><td>&gt; 4.5</td></tr><tr><td>Vote count</td><td>[126, 150]</td><td>[151, 200]</td><td>[201, 250]</td><td>[251, 300]</td><td>&ge;301</td></tr></tbody></table>

<table><caption>TABLE 5. Clustering rules for the genre.</caption><thead><tr><th>Genre</th><th>Freq.</th><th>Genre</th><th>Freq.</th></tr></thead><tbody><tr><td>g<sub>1</sub></td><td>723</td><td>g<sub>6</sub></td><td>287</td></tr><tr><td>g<sub>2</sub></td><td>820</td><td>g<sub>7</sub></td><td>317</td></tr><tr><td>g<sub>3</sub></td><td>425</td><td>g<sub>8</sub></td><td>64</td></tr><tr><td>g<sub>4</sub></td><td>635</td><td>g<sub>9</sub></td><td>49</td></tr><tr><td>g<sub>5</sub></td><td>596</td><td>g<sub>10</sub></td><td>83</td></tr></tbody></table>

<table><thead><tr><th>Frequency</th><th>Cluster</th></tr></thead><tbody><tr><td>&ge;700</td><td>1</td></tr><tr><td>[400, 700]</td><td>2</td></tr><tr><td>[100, 400]</td><td>3</td></tr><tr><td>&lt; 100</td><td>4</td></tr></tbody></table>

1) Evaluate the frequency of each existing genre by counting its number of occurrences in the dataset.

2) Perform a clustering of the existing genre according to user-defined clustering rules related to the frequency of each genre in the dataset, in order to obtain a finite user-defined number of clusters. Consider for example the arbitrary frequencies of each genre presented in Table 4 and the user-defined clustering rules<fnref n="30" /> shown in Table 5, the four following clusters are obtained: 1 = {g₁, g₂}, 2 = {g₃, g₄, g₅}, 3 = {g₆, g₇} and 4 = {g₈, g₉, g₁₀}.

3) Construct a binary number composed of k bits, each bit corresponding to a cluster such that the leftmost bit is attributed to the cluster 1, the next bit is attributed to cluster 2, until the rightmost bit which corresponds to cluster k.

4) Assign the value 1 to the bit corresponding to each genre associated with the movie and assign the value 0 to the remaining bits.

5) Consider the integer corresponding to the resulting binary number as the symbol.

Proceeding this way, a total of (2^k - 1) possible symbols from 1 to (2^k - 1) are obtained to represent the movie genres, because the value 0 can never be obtained. Table 6 shows the symbols associated with the genres of the movies contained in Table 2 according to this principle.

<table><caption>TABLE 6. Symbols associated with the genres of the movies contained in Table 2.</caption><thead><tr><th></th><th>Genres</th><th>Binary</th><th>Symbol</th></tr></thead><tbody><tr><td>x<sub>1</sub></td><td>{g<sub>1</sub>, g<sub>7</sub>}</td><td>1010</td><td>10</td></tr><tr><td>x<sub>2</sub></td><td>{g<sub>2</sub>}</td><td>1000</td><td>8</td></tr><tr><td>x<sub>3</sub></td><td>{g<sub>1</sub>, g<sub>3</sub>, g<sub>9</sub>}</td><td>1101</td><td>13</td></tr><tr><td>x<sub>4</sub></td><td>{g<sub>8</sub>, g<sub>10</sub>}</td><td>0001</td><td>1</td></tr><tr><td>x<sub>5</sub></td><td>{g<sub>2</sub>, g<sub>6</sub>}</td><td>1010</td><td>10</td></tr><tr><td>x<sub>6</sub></td><td>{g<sub>1</sub>, g<sub>3</sub>, g<sub>5</sub>}</td><td>1100</td><td>12</td></tr><tr><td>x<sub>7</sub></td><td>{g<sub>3</sub>, g<sub>4</sub>, g<sub>6</sub>, g<sub>7</sub>}</td><td>0110</td><td>6</td></tr></tbody></table>

date: 7 8 9 10

score: 3 → 4 → 3 → 2

(a) $\delta_1^u(X)$

vote average: 5 3 9 4

score: 3 → 4 → 3 → 2

(b) $\delta_2^u(X)$

vote count: 7 4 8 5

score: 3 → 4 → 3 → 2

(c) $\delta_3^u(X)$

genres: 10 8 13 1

score: 3 → 4 → 3 → 2

(d) $\delta_4^u(X)$

FIGURE 8. MCs of the user u who watched the sequence X = x₁x₂x₃x₄ of movies.

When all the required replacements are performed in Figures 7a to 7d, the Markov chains $\delta_1^u(X)$ to $\delta_4^u(X)$ respectively depicted in Figures 8a to 8d are obtained for the user u. The same principle is applied to obtain the Markov chains of the users v and w.

## 2) MC GENERATION FOR THE CF

In the CF sub-system, the pseudo MC $\bar{\delta}_i^u(X)$ presented in Figure 9 enables to capture the sequential profiles of the viewers of a movie u watched in this order by the sequence X = x₁x₂...x_T of users according to the user feature $f_i \in F$. Suppose for example that $F = \{f_5, \dots, f_8\}$ where:

1) $f_5$ is the age of the user.

<footnote n="30">³⁰These rules are guided by the content of *Movielens-100K*.</footnote>
<figure><img src="image_13.png" /><figcaption>FIGURE 9. Pseudo MC $\bar{\delta}_i^u(X)$ associated with a movie *u* watched by a sequence *X* of users.</figcaption></figure>

<table><caption>TABLE 7. User features of the users *u*, *v* and *w*.</caption><thead><tr><th></th><th>f<sub>5</sub></th><th>f<sub>6</sub></th><th>f<sub>7</sub></th><th>f<sub>8</sub></th></tr><tr><th></th><th>Age</th><th>Gender</th><th>Occupation</th><th>Zip code</th></tr></thead><tbody><tr><th>u</th><td>17</td><td>M</td><td>o<sub>6</sub></td><td>61344</td></tr><tr><th>v</th><td>27</td><td>F</td><td>o<sub>1</sub></td><td>98125</td></tr><tr><th>w</th><td>48</td><td>M</td><td>o<sub>15</sub></td><td>35327</td></tr></tbody></table>

<table><caption>TABLE 8. Sampling used for the age.</caption><thead><tr><th>Value</th><th>Symbol</th></tr></thead><tbody><tr><td>[0, 11]</td><td>1</td></tr><tr><td>[12, 18]</td><td>2</td></tr><tr><td>[19, 30]</td><td>3</td></tr><tr><td>[31, 45]</td><td>4</td></tr><tr><td>[46, 60]</td><td>5</td></tr><tr><td>[61, 75]</td><td>6</td></tr><tr><td>≥76</td><td>7</td></tr></tbody></table>

2) $f_6$ is the gender of the user which is either 'M' for male or 'F' for female.

3) $f_7$ is the occupation of the user belonging to the finite set $\{o_1, o_2, \dots, o_{20}\}$.

4) $f_8$ is the zip code which is a code composed of five characters representing the address of the user, the first character being the reference to a group of states.

Suppose that ($\bar{T}_{max}$ = 3), then the timestamps contained in Table 2 enable to deduce that the movies $x_1, x_3$ and $x_4$ were respectively watched by the sequences $X = uvw$, $Y = vwu$, and $Z = wvu$ of users. Table 7 contains the features of the users *u*, *v* and *w* which enable to derive the pseudo MCs $\bar{\delta}_5^{x_3}(Y)$ to $\bar{\delta}_8^{x_3}(Y)$ presented in Figures 10a to 10d for the movie $x_3$. The pseudo MCs of the other movies are not presented here for space constraints. The score can still be sampled according to the sampling defined in Table 3, while the sampling of Table 8$^{29}$ can be used for the age.

The occupation belongs to a finite set but the cardinality of that set can be high. This induces a high number of symbols for the underlying HMMs and this may lead to high model training times. This problem can be solved through a user-defined clustering of the occupations related to the frequencies of the occupations in the system. The resulting clusters are then considered as symbols. If the frequencies presented in Table 9 and the clustering rules shown in Table 10 are considered, then the seven following clusters are obtained: $1 = \{o_{13}, o_{17}\}$, $2 = \{o_7, o_{10}, o_{18}, o_{19}, o_{20}\}$, $3 = \{o_1, o_4, o_9, o_{14}, o_{16}\}$, $4 = \{o_3, o_{11}, o_{12}, o_{15}\}$, $5 = \{o_5, o_8\}$, $6 = \{o_2\}$ and $7 = \{o_6\}$.

The zip codes can be clustered analogically according to the frequencies of the groups of states (first character of the zip code) in the system. If the frequencies presented

<figure><img src="image_14.png" /></figure>

<figure><img src="image_15.png" /></figure>

<figure><img src="image_16.png" /></figure>

<figure><img src="image_17.png" /><figcaption>FIGURE 10. Pseudo MCs of the movie $x_3$ watched by the sequence $Y = vwu$ of users.</figcaption></figure>

<table><caption>TABLE 9. Examples of occupation frequencies.</caption><thead><tr><th>Value</th><th>Freq.</th><th>Value</th><th>Freq.</th></tr></thead><tbody><tr><td>o<sub>1</sub></td><td>27</td><td>o<sub>11</sub></td><td>66</td></tr><tr><td>o<sub>2</sub></td><td>105</td><td>o<sub>12</sub></td><td>51</td></tr><tr><td>o<sub>3</sub></td><td>45</td><td>o<sub>13</sub></td><td>7</td></tr><tr><td>o<sub>4</sub></td><td>32</td><td>o<sub>14</sub></td><td>28</td></tr><tr><td>o<sub>5</sub></td><td>79</td><td>o<sub>15</sub></td><td>67</td></tr><tr><td>o<sub>6</sub></td><td>196</td><td>o<sub>16</sub></td><td>26</td></tr><tr><td>o<sub>7</sub></td><td>12</td><td>o<sub>17</sub></td><td>9</td></tr><tr><td>o<sub>8</sub></td><td>95</td><td>o<sub>18</sub></td><td>16</td></tr><tr><td>o<sub>9</sub></td><td>31</td><td>o<sub>19</sub></td><td>14</td></tr><tr><td>o<sub>10</sub></td><td>18</td><td>o<sub>20</sub></td><td>12</td></tr></tbody></table>

<table><caption>TABLE 10. Clustering rules for the occupation.</caption><thead><tr><th>Frequency</th><th>Cluster</th></tr></thead><tbody><tr><td>[0, 10]</td><td>1</td></tr><tr><td>[11, 20]</td><td>2</td></tr><tr><td>[21, 40]</td><td>3</td></tr><tr><td>[41, 70]</td><td>4</td></tr><tr><td>[71, 100]</td><td>5</td></tr><tr><td>[101, 150]</td><td>6</td></tr><tr><td>≥151</td><td>7</td></tr></tbody></table>

in Table 11 and the clustering rules shown in Table 12 are considered, then the six following clusters are obtained: $1 = \{E, K, L, M, N, R, T\}$, $2 = \{V\}$, $3 = \{3, 7, 8\}$, $4 = \{0, 1, 4, 6\}$, $5 = \{2, 5\}$ and $6 = \{9\}$. The gender belongs to the small finite set $\{M, F\}$. These two values can thus be considered as symbols.

When all the required replacements are performed in Figures 10a to 10d, the MCs $\bar{\delta}_5^{x_3}(Y)$ to $\bar{\delta}_8^{x_3}(Y)$ respectively depicted in Figures 11a to 11d are obtained for the movie $x_3$.

The same principle is applied to obtain the MCs of the other movies. All the remaining steps of the proposed methodology described in Sections IV-C3 to IV-C5 are valid for the CBF
<table><caption>TABLE 11. Examples of zip code frequencies.</caption><thead><tr><th>1<sup>st</sup> charac.</th><th>Freq.</th><th>1<sup>st</sup> charac.</th><th>Freq.</th></tr></thead><tbody><tr><td>0</td><td>96</td><td>9</td><td>160</td></tr><tr><td>1</td><td>97</td><td><i>E</i></td><td>2</td></tr><tr><td>2</td><td>101</td><td><i>K</i></td><td>1</td></tr><tr><td>3</td><td>62</td><td><i>L</i></td><td>2</td></tr><tr><td>4</td><td>77</td><td><i>M</i></td><td>2</td></tr><tr><td>5</td><td>110</td><td><i>N</i></td><td>2</td></tr><tr><td>6</td><td>78</td><td><i>R</i></td><td>1</td></tr><tr><td>7</td><td>67</td><td><i>T</i></td><td>2</td></tr><tr><td>8</td><td>56</td><td><i>V</i></td><td>20</td></tr></tbody></table>

<figure><img src="image_18.png" /><figcaption>FIGURE 11. MCs of the movie x₃ watched by the sequence Y = vwu of users.</figcaption></figure>

sub-system, as well as for the CF sub-system. In the CBF sub-system, *u* is a user represented by a sequence *X* of movies, while in the CF sub-system, *u* is a movie represented by a sequence *X* of users.

### 3) HMM INITIALIZATION AND TRAINING

Given a positive user-defined constant $\epsilon$, the parameters of the initial HMM $\hat{\lambda}_i^u(X) = (\hat{A}_i^u(X), \hat{B}_i^u(X), \hat{\pi}_i^u(X))$ associated with *u* according to the feature $f_i$ are computed as described below for statistically capturing the state transitions and the symbol probability distributions from the content of $\delta_i^u(X)$:

1) The set of states is $S = \{s_1, \dots, s_n\}$ resulting from the user-defined sampling of the scores.

2) If the values of the feature $f_i$ belong to a set $I$, then the content of the set $\vartheta = \{z_1, \dots, z_{|\vartheta|}\}$ of symbols

depends on the nature of $I$. If $I$ is finite such that $|I|$ is low, then ($\vartheta = I$). This was the case for the gender $f_6$ of each user. But when $I$ is finite such that $|I|$ is high or when $I$ is not finite, user-defined samplings and clustering of $I$ must be applied to obtain a finite set $\hat{I}$ to derive ($\vartheta = \hat{I}$). This was the case for all the features considered in this work, except $f_6$.

3) The probability of transiting from state $s_j$ to state $s_l$ is calculated in Equation 1 where transit($s_j, s_l, \delta_i^u(X)$) is the number of transitions from state $s_j$ to state $s_l$ in $\delta_i^u(X)$ and transit($s_j, -, \delta_i^u(X)$) is the number of transitions from state $s_j$ to any destination in $\delta_i^u(X)$.

$$ \hat{A}_i^u(X)[s_j, s_l] = \frac{\text{transit}(s_j, s_l, \delta_i^u(X))}{\text{transit}(s_j, -, \delta_i^u(X)) + \epsilon} \quad (1) $$

4) The probability to observe symbol $z_l$ at state $s_j$ is calculated in Equation 2 where observe($z_l, s_j, \delta_i^u(X)$) is the number of times symbol $z_l$ is observed from state $s_j$ in $\delta_i^u(X)$, and observe($-, s_j, \delta_i^u(X)$) is the number of occurrences of state $s_j$ in $\delta_i^u(X)$.

$$ \hat{B}_i^u(X)[s_j, z_l] = \frac{\text{observe}(z_l, s_j, \delta_i^u(X))}{\text{observe}(-, s_j, \delta_i^u(X)) + \epsilon} \quad (2) $$

5) The probability of starting with state $s_j$ is calculated in Equation 3, where start($s_j, \delta_i^u(X)$) = 1 if $\delta_i^u(X)$ starts with state $s_j$, otherwise start($s_j, \delta_i^u(X)$) = 0.

$$ \hat{\pi}_i^u(X)[s_j] = \frac{\text{start}(s_j, \delta_i^u(X))}{1 + \epsilon} \quad (3) $$

The parameters of $\hat{\lambda}_i^u(X)$ are not probability distributions due to the user-defined constant $\epsilon$ intentionally added to the denominators of its various components for avoiding eventual divisions by zero or zero-probabilities in the initial model. In order to solve this problem, an equitable redistribution of the missing quantity is applied to each line of each element in $\hat{\lambda}_i^u(X)$ to derive the readjusted initial HMM $\tilde{\lambda}_i^u(X) = (\tilde{A}_i^u(X), \tilde{B}_i^u(X), \tilde{\pi}_i^u(X))$ whose parameters are calculated in Equation 4.

Finally, the readjusted initial HMM $\tilde{\lambda}_i^u(X)$ is trained using the Baum-Welch algorithm [58] III-C that takes as input the sequence of symbols appearing in $\delta_i^u(X)$. This enables to derive the final HMM $\lambda_i^u(X) = (A_i^u(X), B_i^u(X), \pi_i^u(X))$ associated with *u* according to the feature $f_i$. When this principle is executed for each feature in *F*, the set $\{\lambda_1^u(X), \dots, \lambda_k^u(X)\}$ of HMMs is obtained. In the particular case where $|X| \le 1$ (i.e: the length of *X* is 1 or 0), Equations 1 to 4 are still used for constructing the readjusted initial HMM $\tilde{\lambda}_i^u(X)$ associated with *u* according to the feature $f_i$. But this model cannot be trained because there is no sequence to learn and in this case, it is conventionally decided that $(\lambda_i^u(X) = \tilde{\lambda}_i^u(X))$ without
running the Baum-Welch algorithm [58] III-C.

$$
\left\{
\begin{aligned}
\tilde{A}_i^u(X)[s_j, s_l] &= \hat{A}_i^u(X)[s_j, s_l] + \frac{1}{|S|} \left( 1 - \sum_{h=1}^{|S|} \hat{A}_i^u(X)[s_j, s_h] \right) \\
\tilde{B}_i^u(X)[s_j, z_l] &= \hat{B}_i^u(X)[s_j, z_l] + \frac{1}{|\vartheta|} \left( 1 - \sum_{h=1}^{|\vartheta|} \hat{B}_i^u(X)[s_j, z_h] \right) \\
\tilde{\pi}_i^u(X)[s_j] &= \hat{\pi}_i^u(X)[s_j] + \frac{1}{|S|} \left( 1 - \sum_{h=1}^{|S|} \hat{\pi}_i^u(X)[s_h] \right)
\end{aligned}
\right.
\quad (4)
$$

4) META-DATA EXTRACTION

Meta-data related to the behavior of the HMM $\lambda_i^u(X)$ after a sufficiently long time are extracted in order to generate one feature vector $\tilde{u}_i$ associated with $u$ according to the feature $f_i \in F$. The $l^{th}$ component $u_l^i$ of this vector is the overall proportion of time spent by $\lambda_i^u(X)$ observing the symbol $z_l$ after a sufficiently long time, irrespective of the state from which this observation is realized. In order to compute the value of $u_l^i$, one must first use the following principle to evaluate the overall proportion of time spent by $\lambda_i^u(X)$ observing the symbol $z_l$ from state $s_j$ after a sufficiently long time:

1) The overall proportion of time spent by $\lambda_i^u(X)$ in state $s_j$ after a sufficiently long time is initially computed. This proportion is given by the $j^{th}$ component $\varphi_i^u(X)[s_j]$ of the stationary distribution of $\lambda_i^u(X)$.

2) The result obtained at step 1 is multiplied by the probability of observing the symbol $z_l$ from state $s_j$ which is given by $B_i^u(X)[s_j, z_l]$.

The value of $u_l^i$ is finally obtained by repeating this process for every state $s_j$ and by summing the resulting proportions. Equation 5 summarizes the computation scheme of $\tilde{u}_i$.

$$
\left\{
\begin{array}{ll}
\tilde{u}_i = [u_i^1, u_i^2, \dots, u_i^{|\vartheta|}] & \text{where} \\
\\
u_i^l = \sum_{j=1}^{|S|} (\varphi_i^u(X)[s_j] \times B_i^u(X)[s_j, z_l]) & \text{with} \\
(1 \le l \le |\vartheta|)
\end{array}
\right.
\qquad (5)
$$

When Equation 5 is used with the experimental settings specified in Section V-B for the three users $u, v$ and $w$, their resulting feature vectors are presented in Table 13. Similarly, when Equation 5 is applied for the movies $x_3$ and $x_4$, their resulting feature vectors are shown in Table 14. The underlying HMMs are not presented here due to space constraints. Around 20 ms were required for generating the feature vectors presented in Tables 13 and 14.

The components of the proposed feature vectors are easily interpretable. In Table 13 for example, the fact that $(\vec{v}_F[8]=0.5)$ for the movie feature $f_1$ probabilistically means that if the user $v$ sequentially watches movies during a sufficiently long time, he will spend 50% of this time watching movies whose release dates belong to the

sample of rank 8 in Table 3, which correspond to the interval [2011, 2015]. Given that $(\vec{v}_F[9]=0.5)$ for $f_1$, this probabilistically means that $v$ will spend the remaining 50% of this time watching movies whose release dates belong to the sample of rank 9 in Table 3, which correspond to the interval [2016, 2020]. Similarly, the fact that $(\vec{u}_F[13]=1)$ for the movie feature $f_4$ probabilistically means that if the user $u$ sequentially watches movies during a sufficiently long time, he will spend 100% of this time watching movies whose genres belong the set of genres attached to the symbol 13. The decimal value 13 corresponds to the binary value 1101 and thus to the set $\{g_1, g_3, g_9\}$ of genres as described in Table 6. An analog reasoning in Table 14 for the user feature $f_5$ enables to probabilistically deduce that after a sufficiently long time, the movie $x_1$ will be watched during 100% of this time by users in the age range [46, 60] which corresponds to the sample of rank 5 in Table 8. The remaining components of all the vectors presented in Tables 13 and 14 can be interpreted analogically.

5) FINAL VECTOR COMPUTATION

The final feature vector $\tilde{u}_F$ associated with $u$ according to the set $F$ of features is obtained by concatenating the components of the feature vectors generated for all the features in $F$ as described in Equation 6. The final feature vectors associated with the users $u, v$ and $w$, as well as those of the movies $x_1, x_3$ and $x_4$ are respectively obtained by concatenating the vectors appearing in each column of Tables 13 and 14, from the first line to the last line of each column.

$$
\tilde{u}_F = \underbrace{\mathbf{concat}}_{i=1,...,k} (\tilde{u}_i) \quad (6)
$$

In the proposed system, two different users can have identical final feature vectors due to the sampling and the clustering performed during the generation of the MCs. This observation is valid for two different movies that can be associated with identical final feature vectors. In practice, the final feature vector $\tilde{u}_F$ of $u$ must be recalculated periodically according to a fixed period (e.g., every 12 hours, daily, weekly, monthly, etc.). In a streaming platform, the proposed system would not be able to update instantly after every user interaction, but instead rely on batch updates. More precisely, new ratings and new viewing sequences are collected in real-time, temporarily stored into buffers, and then incorporated into the HMMs at the next scheduled recalculation. To approximate real-time responsiveness, the system can also combine these periodic updates with popular lightweight incremental updates [60], [61], [62] (e.g., boosting recent movies watched, decay of older interactions) until the next full retraining.

It is important to notice that in the CBF sub-system, $\tilde{u}_F$ does not only capture the current sequential preferences of the user $u$, but it additionally captures the sequential preferences of $u$ after a sufficiently long time. Indeed, the use of the stationary distribution in Equation 5 during the computation of $\tilde{u}_F$ implies that the proposed approach relies on the current
<table><caption>**TABLE 13.** Feature vectors associated with the users *u*, *v* and *w* who respectively watched the sequences *X* = *x*₁*x*₂*x*₃*x*₄, *Y* = *x*₃*x*₅*x*₆*x*₂*x*₁*x*₇*x*₄ and *Z* = *x*₄*x*₇*x*₃*x*₅*x*₁ of movies described in Table 2.</caption><thead><tr><th></th><th>u</th><th>v</th><th>w</th></tr></thead><tbody><tr><th>f<sub>1</sub></th><td>[0, 0, 0, 0, 0, 0, 0, 1, 0]</td><td>[0, 0, 0, 0, 0, 0, 0.5, 0.5, 0]</td><td>[0, 0, 0, 0, 0, 1, 0, 0, 0]</td></tr><tr><th>f<sub>2</sub></th><td>[0, 0, 0, 0, 0, 0, 0, 1, 0]</td><td>[0, 0, 0.5, 0, 0, 0.5, 0, 0, 0]</td><td>[0, 0, 0, 0.07, 0.33, 0.13, 0, 0.27, 0.20, 0]</td></tr><tr><th>f<sub>3</sub></th><td>[0, 0, 0, 0, 0, 0, 1, 0, 0]</td><td>[0, 0, 0, 0.67, 0, 0.33, 0, 0, 0]</td><td>[0, 0, 0, 0, 0, 0, 1, 0, 0]</td></tr><tr><th>f<sub>4</sub></th><td>[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0]</td><td>[0, 0, 0, 0, 0.5, 0, 0, 0, 0, 0.5, 0, 0, 0]</td><td>[0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0]</td></tr></tbody></table>

<table><caption>**TABLE 14.** Feature vectors associated with the movies *x*₁, *x*₃ and *x*₄ that were respectively watched by the sequences *X* = *uvw*, *Y* = *vwu* and *Z* = *wvu* of users described in Table 2.</caption><thead><tr><th></th><th>x<sub>1</sub></th><th>x<sub>3</sub></th><th>x<sub>4</sub></th></tr></thead><tbody><tr><th>f<sub>5</sub></th><td>[0, 0, 0, 0, 1, 0, 0]</td><td>[0, 0.63, 0.12, 0, 0.25, 0, 0]</td><td>[0, 1, 0, 0, 0, 0, 0]</td></tr><tr><th>f<sub>6</sub></th><td>[1, 0]</td><td>[1, 0]</td><td>[1, 0]</td></tr><tr><th>f<sub>7</sub></th><td>[0, 0, 0, 1, 0, 0, 0]</td><td>[0, 0, 0.12, 0.25, 0, 0, 0.63]</td><td>[0, 0, 0, 0, 0, 0, 1]</td></tr><tr><th>f<sub>8</sub></th><td>[0, 0, 1, 0, 0, 0]</td><td>[0, 0, 0.25, 0.63, 0, 0.12]</td><td>[0, 0, 0, 1, 0, 0]</td></tr></tbody></table>

sequential preferences of *u* extracted from the sequence *X* = *x*₁...*x*ₜ of movies recently watched by *u*, to probabilistically learn the *future* sequential preferences of *u*. Hence, $\vec{u}_F$ characterizes the sequence $\vec{X} = x_1...x_T x_{T+1} x_{T+2}...x_{T+k}$ containing *k* additional movies that are more likely supposed to be watched by *u* after a sufficiently long time. The same remark is valid in the CF sub-system where $\vec{u}_F$ captures both, the current and the future sequential profiles of the viewers of the movie *u* according to *F*.

## D. APPLICATIONS

### 1) USER AND MOVIE COMPARISON

Consider two users *u* and *v* respectively associated with the vectors $\vec{u}_F$ and $\vec{v}_F$ in the CBF sub-system, where *F* is a set of movie features. The distance $D_F^d(u, v)$ between *u* and *v* can be calculated through the evaluation of the distance between $\vec{u}_F$ and $\vec{v}_F$ using any valid vector distance *d* (e.g., Euclidean, Manhattan, etc.) as described in Equation 7. This equation evaluates how much the sequential preferences of *u* and *v* are currently different, and how much they are more like to be different in the future, according to the movie features in *F*. The computation schemes of more than 60 existing distance measures between two vectors that can be used for this purpose are available in [63].<fnref n="31" /> When Equation 7 is applied with the Euclidean and the Manhattan distances to the three users *u*, *v* and *w* whose feature vectors are presented in Table 13, the distances shown in Table 15 are obtained.

$$D_F^d(u, v) = d(\vec{u}_F, \vec{v}_F) \qquad (7)$$

In the CF sub-system, Equation 8 enables to compute the distance $\bar{D}_G^d(x, y)$ between two movies *x* and *y* whose feature vectors are respectively $\bar{x}_G$ and $\bar{y}_G$, *G* being a set of user features. The equation evaluates how much the sequential profiles of the viewers of *x* and *y* are currently different, and how much they are more like to be different in the future, according to the user features in *G*. Equation 8 enables to compare the movies *x*₁, *x*₃ and *x*₄ whose feature vectors are

<table><caption>**TABLE 15.** Euclidean and Manhattan distances between the users *u*, *v* and *w* whose feature vectors are presented in Table 13 when $F = \{f_1, f_2, f_3, f_4\}$.</caption><thead><tr><th>d</th><th>D<sup>d</sup><sub>F</sub>(u, v)</th><th>D<sup>d</sup><sub>F</sub>(u, w)</th><th>D<sup>d</sup><sub>F</sub>(v, w)</th></tr></thead><tbody><tr><td>Eucli.</td><td>2.248</td><td>2.201</td><td>2.273</td></tr><tr><td>Manha.</td><td>7</td><td>5.6</td><td>7.733</td></tr></tbody></table>

presented in Table 14 using the same metrics, the results are presented in Table 16.

$$\bar{D}_G^d(x, y) = d(\bar{x}_G, \bar{y}_G) \qquad (8)$$

### 2) PREDICTED SCORE OF A MOVIE

In the rest of the current work, assume that the system data are recorded in a dataset $\mathcal{D} = (\mathcal{U}, \mathcal{M})$ where $\mathcal{U}$ contains the user data and $\mathcal{M}$ contains the movie data. Consider a user *u* who chronologically watched and rated the movies in the sequence $X_u = x_1...x_T$. Given any movie *y* of the system, *u* might like *y* at most the same way he liked the nearest neighbor of *y* among the movies in $X_u$. This preference must decrease as the distance $d_{min} = \bar{D}_G^d(y, x_i)$ between *y* and that nearest neighbor grows. Equation 9 relies on the above analysis to predict the score $\bar{\alpha}^u(y)$ that might be assigned by *u* to *y* in such a way that its initial value $\alpha^u(x_i) \times \left(1 - \frac{d_{min}}{d_{max}}\right)$ is naturally close to the effective score $\alpha^u(x_i)$ assigned by *u* to the nearest neighbor $x_i$ of *y* among the movies already watched by *u*.

$$ \left\{ \begin{array}{l} \bar{\alpha}^u(y) = \frac{1}{|Z|} \sum_{x_i \in Z} \left( \alpha^u(x_i) \times \left( 1 - \frac{d_{min}}{d_{max}} \right) \right) \quad \text{where} \\ Z = \{x_i \in X_u \mid \bar{D}_G^d(y, x_i) = d_{min}\} \quad \text{and} \\ d_{min} = \min \left\{ \bar{D}_G^d(y, x_i) \mid x_i \in X_u \right\} \quad \text{and} \\ d_{max} = \max \left\{ \bar{D}_G^d(x_j, x_k) \mid (x_j, x_k) \in \mathcal{M}^2 \right\} \end{array} \right. \qquad (9) $$

<footnote n="31">³¹See Tables 1 to 8 and Table 10 of [63].</footnote>
<table><caption>TABLE 16. Euclidean and Manhattan distances between the movies $x_1, x_3$ and $x_4$ whose feature vectors are presented in Table 14 when $G = \{f_5, f_6, f_7, f_8\}$.</caption><thead><tr><th>d</th><th>D&#773;<sup>d</sup><sub>G</sub>(x<sub>1</sub>, x<sub>3</sub>)</th><th>D&#773;<sup>d</sup><sub>G</sub>(x<sub>1</sub>, x<sub>4</sub>)</th><th>D&#773;<sup>d</sup><sub>G</sub>(x<sub>3</sub>, x<sub>4</sub>)</th></tr></thead><tbody><tr><td>Eucli.</td><td>1.704</td><td>2.449</td><td>0.81</td></tr><tr><td>Manha.</td><td>4.5</td><td>6</td><td>2.25</td></tr></tbody></table>

In that equation, $d_{max}$ is the maximum distance between any two movies in $M$. When $y$ and $x_i$ are very close (i.e.: $d_{min} \approx 0$), the penalty coefficient becomes very near to 1 (i.e.: $(1 - \frac{d_{min}}{d_{max}}) \approx (1 - \frac{0}{d_{max}}) \approx 1$). In such conditions, these two scores become very close (i.e.: $\bar{\alpha}^u(y) \approx \alpha^u(x_i) \times 1 \approx \alpha^u(x_i)$). This drops the gap between them to a value very close to zero (i.e.: $\bar{\alpha}^u(y) - \alpha^u(x_i) \approx 0$). If $u$ is a viewer of $y$, this approximation becomes a strict equality. Since both the RMSE and the MAE which evaluate the rating prediction quality are calculated based on this gap, these two errors also drop to values very close to zero in these conditions.

Considering further that the larger the dataset, the greater the probability of having several movies eligible as nearest neighbors of $y$, the average of their individual initial predicted scores is considered as the final predicted score in Equation 9. The value $(\bar{\alpha}^u(y) = 0)$ is conventionally considered when $u$ has watched no movie (i.e.: $|X_u| = 0$).

### 3) HYBRID MOVIE RECOMMENDATION

Consider two users $u$ and $v$ whose final feature vectors according to the set $F$ of movie features are respectively $\vec{u}_F$ and $\vec{v}_F$. The recommendation principle proposed in the current work relies on the observation that the closer the vectors $\vec{u}_F$ and $\vec{v}_F$ are, the more $u$ and $v$ currently have close sequential preferences, while being more likely to have close sequential preferences in the future. Consequently, one can logically recommend to any of these two users the movies currently watched by the other user because their sequential preferences actually match, and are also more likely to match in the future. More formally, given a vector distance $d$, when the users $u$ and $v$ are close (i.e.: $D_F^d(u, v) \approx 0$), it is accurate to recommend to $u$ the movies watched by $v$ and reciprocally, to recommend to $v$ the movies watched by $u$.

As a consequence, an analysis of the neighborhood of the vector associated with a user $u$ who watched a sequence $X_u$ of movies, can lead to a finer recommendation. Given a user-defined positive integer $K$, the KNN algorithm [64] is initially executed using the user distance $D_F^d$ as metric to construct the set $V = \{v_1, \dots, v_K\}$ containing the $K$ nearest neighbors of $u$ among all the system users and verifying $D_F^d(u, v_i) \le D_F^d(u, v_{i+1})$, with $(1 \le i \le K - 1)$. The users in $V$ currently have close sequential preferences to those of $u$, while being more likely to have close sequential preferences to those of $u$ in the future. In these conditions, the initial set $R^F(u)$ of movies that can be recommended to $u$ by the proposed approach relies on the CBF sub-system and is constructed by gathering all the movies watched by his $K$

nearest neighbors. Suppose that each neighbor $v_i$ of $u$ watched the sequence $Y_i$ of movies, with $(1 \le i \le K)$, Equation 10 shows how to construct $R^F(u)$ in these conditions.

$$R^F(u) = \left( \bigcup_{i=1}^{K} \{y \in Y_i\} \right) \quad (10)$$

The cardinality of the set $R^F(u)$ can become very high depending on the number of movies watched by each neighbor and of the number $K$ of neighbors. This can increase the user's cognitive load during the selection of a recommended movie. To overcome this limitation, it is preferable in practice to integrate a bidirectional navigating interface that will enable to sequentially navigate through the movies in $R^F(u)$. Let $V(y) = \{v \in V | v \text{ watched } y\}$ be the set of neighbors of $u$ who watched a movie $y$. The order in which the movies in $R^F(u)$ are visited during this navigation must be guided by a criterion which takes into account the following parameters for each recommended movie $y \in R^F(u)$:

1) The value of $|V(y)|$. Indeed, the greater is the number of neighbors of $u$ who were interested by $y$, the more likely $u$ is to also be interested by $y$.

2) The movie distance $D_G^d(y, x)$ between $y$ and each movie $x \in X_u$, where $G$ is the set of user features. In fact, the closer $y$ is to the movies watched by the user $u$, the greater is the probability that $u$ also likes $y$.

3) The score $\alpha^u(x)$ attributed by $u$ to each movie $x \in X_u$, because $u$ may probably like any movie which is very close to $x$, the same way he likes $x$. This preference decreases as the distance between $x$ and $y$ grows.

Regarding these parameters, the CF sub-system is used to define in Equation 11 the importance $\beta_G^d(y, u)$ of each movie $y \in R^F(u)$ in the neighborhood of $u$. In that equation, $\epsilon$ is a tiny positive user-defined floating-point constant added here for avoiding eventual divisions by zero. The proposed importance effectively takes into account the aforementioned parameters because $\beta_G^d(y, u)$ is a weighted sum of scores whose value is increased by high values of $|V(y)|$ and by small values of $D_G^d(y, x)$. The natural logarithm is used here as a smoothing function because the effective distances between movies are most often small numbers that induce huge values of the importance that are less sensitive to comparisons. The value $(\beta_G^d(y, u) = 0)$ is conventionally considered when $u$ has watched no movie (i.e.: $|X_u| = 0$).

$$\beta_G^d(y, u) = \ln \left[ |V(y)| \times \left( \sum_{x \in X_u} \frac{\alpha^u(x)}{D_G^d(y, x) + \epsilon} \right) \right] \quad (11)$$

The movies in the set $R^F(u)$ are finally sorted in descending order of their importance to obtain the ordered list $R_G^F(u)$ of movies recommended to $u$. In many of the existing RSs, in order to avoid user cognitive overload, the system manager performs the Top-n recommendation principle, where $n$ is a positive integer. This consists in saving only the $n$ first movies of $R_G^F(u)$ in a list $N_G^F(u)$, before recommending the content of $N_G^F(u)$ to $u$. As a consequence, $\beta_G^d(y, u)$ directly impacts
<figure><img src="image_19.png" /><figcaption>FIGURE 12. Overall HMM-based hybrid movie recommendation process.</figcaption></figure>

on the values of ranking quality evaluation metrics (e.g., precision, recall, F1 score, NDCG). A quest for the state-of-the-art of Top-n recommendation algorithms was proposed by Anelli et al. in 2022 [54]. Algorithm 1 summarizes the hybrid computation scheme of $\mathcal{R}_G^F(u)$ and $\mathcal{N}_G^F(u)$ for a user $u$, given a dataset $\mathcal{D} = (\mathcal{U}, \mathcal{M})$.

**Algorithm 1 Hybrid-Recommendation**

Inputs: $u, \mathcal{D}, F, G, K, d, n$

Outputs: $\mathcal{R}_G^F(u), \mathcal{N}_G^F(u)$

1: $V \leftarrow \text{KNN}(K, u, \mathcal{D}, \mathcal{D}_F^d)$

2: $\mathcal{R}^F(u) \leftarrow \text{WatchedMovies}(V, \mathcal{D})$

3: **for each** ($y \in \mathcal{R}^F(u)$) **do**

4: &nbsp;&nbsp;&nbsp;&nbsp;y.β ← $\beta_G^d(y, u)$

5: **end for**

6: $\mathcal{R}_G^F(u) \leftarrow \text{SortBy}\beta(\mathcal{R}^F(u))$

7: $\mathcal{N}_G^F(u) \leftarrow \text{FirstMovies}(n, \mathcal{R}_F^u)$

8: **return** $\mathcal{R}_G^F(u), \mathcal{N}_G^F(u)$

Algorithm 1 starts with the KNN algorithm in order to save in $V$ the $K$ nearest neighbors of the user $u$ among all the system users in $\mathcal{D}$, according to the user distance $\mathcal{D}_F^d$ calculated with Equation 7 in the CBF sub-system (line 1). All the movies watched by these users are then extracted from $\mathcal{D}$ and saved in the initial set $\mathcal{R}_F^u$ of recommendations using Equation 10 (line 2). Thereafter, the importance $\beta_G^d(y, u)$ of each recommended movie $y \in \mathcal{R}_F^u$ for the user $u$ is evaluated with Equation 11 that uses the movie distance $\bar{\mathcal{D}}_G^d$ computed with Equation 8 in the CF sub-system (lines 3-5). The ordered list $\mathcal{R}_G^F(u)$ of recommended movies is subsequently constructed through the sorting of the movies in $\mathcal{R}^F(u)$, in the descending order of their importance (line 6). The $n$ first movies of the list $\mathcal{R}_G^F(u)$ are finally saved in the

short list $\mathcal{N}_G^F(u)$ (line 7), before to return $\mathcal{R}_G^F(u)$ and $\mathcal{N}_G^F(u)$ (line 8). Figure 12 provides a graphical overview of the entire HMM-based hybrid movie recommendation process performed in the proposed system.

E. COLD-START MANAGEMENT STRATEGIES

In the proposed framework, no HMM training can be performed for a new movie $y$ or a new user $u$, since their respective associated sequences $X_y$ and $X_u$ contain at most one element (i.e., $|X_y| \le 1$ and $|X_u| \le 1$). Such entities are therefore initialized using the default HMM parameters described in Section IV-C3, which may lead to suboptimal performance. To address this limitation, two post-recommendation strategies, summarized in Algorithms 2 and 3, are introduced to handle cold-start cases for new movies and new users, respectively. These algorithms are executed after Algorithm 1.

1) RECOMMENDATION OF NEW MOVIES

When a new movie $y$ is introduced into the system, its HMM cannot be trained due to the absence of historical viewing data. To initialize recommendations for such movies, a **content-based neighborhood propagation strategy** is employed. The underlying assumption is that movies with similar descriptive features tend to attract similar audiences.

Considering the movie attributes available in the datasets used in this study, each movie is represented by a two-dimensional feature vector $[a_1, a_2]$, where $a_1$ encodes the sample of its release date and $a_2$ represents the cluster of its genres. Given a user-defined positive integer $K_1$ and a distance metric $d$, the $K_1$ non-cold movies most similar to each new movie $y$ are identified and stored in the set $A$. Let $B$ denote the set of $\bar{t}_{max}$ most recent viewers of the movies in $A$. The new movie $y$ is then inserted as the last element in the
recommendation list of each user in B. The overall process is described in Algorithm 2.

**Algorithm 2 Cold-Start-Movies**

Inputs: $\mathcal{D}$, $K_1$, $d$, $\bar{t}_{max}$, $\{\mathcal{R}_G^F(u) | u \in \mathcal{U}\}$

Outputs: $\{\mathcal{R}_G^F(u) | u \in \mathcal{U}\}$

1: **for each** ($y \in \mathcal{M}$) **do**

2: &nbsp;&nbsp;&nbsp;&nbsp; $a_1 \leftarrow \text{sampleOf}(y.release_date)$

3: &nbsp;&nbsp;&nbsp;&nbsp; $a_2 \leftarrow \text{clusterOf}(y.genres)$

4: &nbsp;&nbsp;&nbsp;&nbsp; $\vec{y} \leftarrow [a_1, a_2]$

5: **end for**

6: Cold $\leftarrow \{y \in \mathcal{M} | \text{Viewers}(y) \le 1\}$

7: $V \leftarrow \{\vec{y} | y \in (\mathcal{M} - \text{Cold})\}$

8: **for each** ($y \in \text{Cold}$) **do**

9: &nbsp;&nbsp;&nbsp;&nbsp; $A \leftarrow \text{KNN}(K_1, \vec{y}, V, d)$

10: &nbsp;&nbsp;&nbsp;&nbsp; $B \leftarrow \emptyset$

11: **for each** ($x \in A$) **do**

12: &nbsp;&nbsp;&nbsp;&nbsp; $W \leftarrow \text{RecentViewers}(x, \bar{t}_{max})$

13: &nbsp;&nbsp;&nbsp;&nbsp; $B \leftarrow B \cup W$

14: **end for**

15: **for each** ($u \in B$) **do**

16: &nbsp;&nbsp;&nbsp;&nbsp; Append($\mathcal{R}_G^F(u)$, $y$)

17: **end for**

18: **end for**

19: **return** $\{\mathcal{R}_G^F(u) | u \in \mathcal{U}\}$

Algorithm 2 first computes the feature vector for each movie (lines 1–5) and then stores in A the $K_1$ nearest neighbors of each new movie y (lines 6–9). The $\bar{t}_{max}$ recent viewers of these neighbors are later stored in B (lines 10–14). Finally, y is inserted as the last element in the recommendation list of each user in B (lines 15–17).

This strategy enables each new movie to be proactively recommended to ($K_1 \times \bar{t}_{max}$) users, thereby promoting its initial exposure while preserving recommendation relevance. The parameters $K_1$ and $\bar{t}_{max}$ jointly control the tradeoff between exploration (increasing the visibility of new movies) and selectivity (targeting users with higher potential affinity). In practice, these parameters should be tuned such that ($K_1 \times \bar{t}_{max} \le 50$) to ensure controlled diffusion of new movie recommendations.

## 2) RECOMMENDATION FOR NEW USERS

A symmetric strategy is applied to new users, whose lack of historical viewing sequences similarly prevents HMM training. To generate initial recommendations, a **demographic neighborhood propagation mechanism** is adopted, based on the assumption that users with similar demographic profiles tend to exhibit similar viewing preferences.

Considering the user demographic features available in the datasets used in this study, each user is represented by a four-dimensional feature vector $[b_1, b_2, b_3, b_4]$, where $b_1, b_2$,

$b_3$, and $b_4$ respectively encode the user's age sample, gender (binary value), occupation cluster, and zip-code cluster. Given a user-defined positive integer $K_2$ and a distance metric $d$, the $K_2$ non-cold users nearest to each new user $u$ are identified and stored in the set A. Let B denote the set containing the $t_{max}$ movies most recently watched by the users in A. The movies in B are then sorted according to their vote counts and recommended to u.

The procedure is summarized in Algorithm 3. The algorithm first computes the feature vector for each user (lines 1–7), stores in A the $K_2$ nearest neighbors of each new user (lines 8–11), and then stores in B the $t_{max}$ movies most recently watched by these neighbors (lines 12–16). These movies are later sorted according to their vote counts, then finally recommended to u (line 17).

This approach ensures that each new user receives ($K_2 \times t_{max}$) recommendations derived from demographically similar users, providing a content-based approximation of latent preferences until sufficient behavioral data become available. To maintain focus and prevent redundancy in the context of Top-n recommendation, it is recommended that ($K_2 \times t_{max} \approx n$).

## F. THEORETICAL TIME COST

Consider a set F of movie features, a set G of user features, a vector distance d and a dataset $\mathcal{D} = (\mathcal{U}, \mathcal{M})$. The goal of this section is to evaluate the theoretical time cost of the three main contributions of the current work which are:

1) The final user feature vector $\vec{u}_F$ associated with each user ($u \in \mathcal{U}$) according to F calculated in the CBF subsystem.

2) The final movie feature vector $\vec{x}_G$ associated with each movie ($x \in \mathcal{M}$) according to G calculated in the CF subsystem.

3) The hybrid recommendation system which recommends the ordered lists $\mathcal{R}_G^F(u)$ and $\mathcal{N}_G^F(u)$ of movies to each user ($u \in \mathcal{U}$) using Algorithm 1.

### 1) CBF VECTOR COMPUTATION TIME

Suppose that $T_u$ is the number of relevant movies watched by each user ($u \in \mathcal{U}$), and assume that N refers to the user-selected number of samples resulting from the sampling of the scores attributed to the movies by the users (e.g., N = 5 in Table 3). The theoretical time required by each step of the proposed methodology for the computation of the single feature vectors associated with $u$ according to each movie feature in F is evaluated as follows:

1) **MC generation:** This step is dominated by the access to the user data (watched movies and scores) related to $u$ in $\mathcal{U}$ and to the movie data (movie features) related to the $T_u$ movies watched by $u$ in $\mathcal{M}$. In practice, the access to these data is performed once and enables to derive all the MCs associated with $u$, for all the movie features in F. Hence, this step roughly runs in $O(a +$
**Algorithm 3 Cold-Start-Users**

Inputs: $\mathcal{D}$, $K_2$, $d$, $t_{max}$

Outputs: $\{\mathcal{R}_G^F(u) | \text{WatchedMovies}(u) \le 1\}$

1: **for each** ($u \in \mathcal{U}$) **do**

2: $b_1 \leftarrow \text{sampleOf}(u.\text{age})$

3: $b_2 \leftarrow \text{binaryOf}(u.\text{gender})$

4: $b_3 \leftarrow \text{clusterOf}(u.\text{occupation})$

5: $b_4 \leftarrow \text{clusterOf}(u.\text{zip\_code})$

6: $\vec{u} \leftarrow [b_1, b_2, b_3, b_4]$

7: **end for**

8: Cold $\leftarrow \{u \in \mathcal{U} | \text{WatchedMovies}(u) \le 1\}$

9: $V \leftarrow \{\vec{u} | u \in (\mathcal{U} - \text{Cold})\}$

10: **for each** ($u \in \text{Cold}$) **do**

11: $A \leftarrow \text{KNN}(K_2, \vec{u}, V, d)$

12: $B \leftarrow \emptyset$

13: **for each** ($x \in A$) **do**

14: $W \leftarrow \text{RecentWatchedMovies}(x, t_{max})$

15: $B \leftarrow B \cup W$

16: **end for**

17: $\mathcal{R}_G^F(u) \leftarrow \text{SortByVoteCounts}(B)$

18: **end for**

19: **return** $\{\mathcal{R}_G^F(u) | u \in C\}$

$b.T_u$) where $a$ is the maximum time required to access one user data in $\mathcal{U}$ and $b$ is the maximum time required to access one movie data in $\mathcal{M}$. In the worst case where $(T_u=T_{max})$ for every user $u$, this step therefore runs in $\mathcal{O}(a+b.T_{max})$.

2) **HMM initialization and training:** The time required for initializing a HMM was experimentally very low compared to the model training time. This step is therefore dominated by the model training phase, which runs in around $\mathcal{O}(\gamma.T_u.N^2)$ according to Section III-C, where $\gamma$ is the user-defined maximum number of iterations of the Baum-Welch algorithm. In the worst case where $(T_u=T_{max})$ for every user $u$, this step runs in $\mathcal{O}(\gamma.T_{max}.N^2)$.

3) **Meta-data extraction:** The most time consuming operation realized during this step is the computation of the stationary distribution, which runs in around $\mathcal{O}(r.N^3)$ as stated in Section III-D, where $r$ is the user-defined number of matrix products.

When this analysis is repeated for the $|F|$ movie features, the overall time $\rho$ required for the computation of the final vector associated with each user $u$ according to the movie features in $F$ is calculated in Equation 12.

$$ \left\{ \begin{array}{ll} \rho = \mathcal{O}\left(\sum_{i=1}^{3} \rho_i\right) & \text{where} \\ \rho_1 = (a + b.T_{max}) & \text{and} \\ \rho_2 = |F| \times (\gamma.T_{max}.N^2) & \text{and} \\ \rho_3 = |F| \times (r.N^3) & \end{array} \right. \qquad (12) $$

## 2) CF VECTOR COMPUTATION TIME

Suppose that $T_x$ is the number of relevant users who watched each movie ($x \in \mathcal{M}$) and let us assume that $N$ also refers to the user-selected number of samples resulting from the sampling of the scores attributed to the movies by the users. Analogically to the analysis realized for the CBF sub-system, the overall time $\bar{\rho}$ required for the computation of the final vector associated with each movie $x$ according to the user features in $G$ is calculated using in Equation 13.

$$ \left\{ \begin{array}{ll} \bar{\rho} = \mathcal{O}\left(\sum_{i=1}^{3} \bar{\rho}_i\right) & \text{where} \\ \bar{\rho}_1 = (b + a.T_{max}) & \text{and} \\ \bar{\rho}_2 = |G| \times (\gamma.T_{max}.N^2) & \text{and} \\ \bar{\rho}_3 = |G| \times (r.N^3) & \end{array} \right. \qquad (13) $$

## 3) HYBRID RECOMMENDATION TIME

The time cost of Algorithm 1 can be calculated line-by-line as follows:

1) In line 1, the KNN algorithm is executed with the user distance $D_F^d$ to obtain the $K$ nearest neighbors of the user $u$. This algorithm initially calculates $(|\mathcal{U}| - 1)$ distances between $u$ and the remaining users in $\mathcal{U}$, before sorting these $(|\mathcal{U}| - 1)$ users according to the resulting distances. Suppose that $c$ refers to the time required to compute the distance $D_F^d(u, v)$ between two users, then the computation of all the distances runs in $\mathcal{O}(c.(|\mathcal{U}| - 1))$. Suppose also that an optimal sorting algorithm like the QuickSort [65] algorithm which runs in $\mathcal{O}((|\mathcal{U}| - 1) \log(|\mathcal{U}| - 1))$ is then used, the overall KNN algorithm runs in $\mathcal{O}(c.(|\mathcal{U}| - 1) + (|\mathcal{U}| - 1) \log(|\mathcal{U}| - 1))$. When $|\mathcal{U}|$ is high, one can consider that $(|\mathcal{U}| - 1) \approx |\mathcal{U}|$. Therefore, this step approximately runs in $\mathcal{O}(c.|\mathcal{U}| + |\mathcal{U}| \log(|\mathcal{U}|))$.

2) Line 2 accesses the data of the $T_v$ movies watched by each neighbor $v$ of $u$. In the worst case where $(T_v=T_{max})$ for every neighbor $v$, this step runs in $\mathcal{O}(K.b.T_{max})$ when the $K$ neighbors of $u$ are considered.

3) Lines 3 to 5 compute the importance $\beta_G^d(y, u)$ of each movie $y$ watched by each neighbor of $u$ whose complexity is dominated by the computation of the distances between movies and by the evaluation of the natural logarithm function. Given that there are $K$ neighbors and that each neighbor watched at most $T_{max}$ movies in the worst case, this step requires the computation of $K.T_{max}$ movie distances. Assume now that $l$ and $\bar{c}$ respectively refer to the time required to compute the natural logarithm and to compute the distance $\bar{D}_G^d$ between two movies, then this step approximately runs in $\mathcal{O}(\bar{c}.K.T_{max} + K.l)$.

4) In line 6, the movies watched by the $K$ neighbors of $u$ are sorted using an optimal sorting algorithm like the QuickSort algorithm. In the worst case
where each neighbor watched $T_{max}$, this step runs in $O(K.T_{max}.log(K.T_{max}))$.

5) The time costs of the line 7 which selects the *n* first recommended movies and that of the line 9 which returns the lists of recommended movies can be neglected.

When the sum of all these partial time complexities is realized, the overall time $\theta$ required for recommending movies to the user *u* is obtained as described in Equation 14.

$$ 
\left\{ 
\begin{array}{ll}
\theta = \mathcal{O}\left( \sum_{i=1}^{4} \theta_i \right) & \text{where} \\
\theta_1 = c.|\mathcal{U}| + |\mathcal{U}| \log(|\mathcal{U}|) & \text{and} \\
\theta_2 = K.b.T_{max} & \text{and} \\
\theta_3 = \bar{c}.K.T_{max} + K.l & \text{and} \\
\theta_4 = K.T_{max} \cdot \log(K.T_{max}) &
\end{array}
\right. 
\quad (14) 
$$

### 4) OVERALL TIME COST

The overall time required by the proposed system is computed in Equation 15. That equation simply computes the sum of:

1) The time required for computing the final feature vectors of all the system users.

2) The time required for computing the final feature vectors of all the movies in the system.

3) The time required for recommending movies to all the system users.

$$ Time \approx \mathcal{O}(\rho.|\mathcal{U}| + \bar{\rho}.|\mathcal{M}| + \theta.|\mathcal{U}|) \quad (15) $$

The parameters $\gamma$, $r$, $K$, $T_{max}$, $\bar{T}_{max}$ and $N$ appearing in the Equations 12, 13 and 14 are user-defined constants. Thus, the overall time cost of the proposed system is mostly impacted by the remaining parameters which depend on the experimental dataset and computer.

## V. EXPERIMENTAL RESULTS

The goal of this section is to evaluate how much some selected parameters of the proposed approach can impact the performances of the proposed RS. Movie recommendation experiments have been conducted for this purpose on three open movie datasets and the performances of the proposed approach have been evaluated for various values of:

1) The maximum number $T_{max}$ of movies recently watched by each user such that ($T_{max} \le |\mathcal{M}|$).

2) The maximum number $\bar{T}_{max}$ of users who recently watched a movie such that ($\bar{T} \le |\mathcal{U}|$).

3) The value of *n* for the Top-*n* recommendation.

4) The number *K* of neighbors of each user.

5) The distance *d* used in Algorithm 1.

## A. EXPERIMENTAL DATA AND SOURCE CODES

Movie recommendation experiments were conducted on the open datasets *Movielens-100K*, *Movielens-1M* and *Movielens-20M*, all downloaded from the *Kaggle* repository ¹³. Table 17 summarizes the composition of these datasets.

<table><caption>TABLE 17. The three experimental datasets.</caption><thead><tr><th></th><th>Users</th><th>Movies</th><th>Ratings</th></tr></thead><tbody><tr><td>Movielens-100K</td><td>943</td><td>1682</td><td>100.000</td></tr><tr><td>Movielens-1M</td><td>6040</td><td>3883</td><td>1.000.209</td></tr><tr><td>Movielens-20M</td><td>138493</td><td>27274</td><td>20.000.263</td></tr></tbody></table>

Since user features (age, gender, occupation and Zip code) are not available in *Movielens-20M*, no HMM was trained for learning the user profiles in that dataset. Each movie was instead represented by a 4-dimensional vector composed of the sampled or clustered values of its handcrafted features (release date, vote average, vote count and genres). Proceeding this way relatively harms the performances of the proposed system since the sequential user profiles are not learned. Indeed, unreported analog experiments conducted in *Movielens-1M* without HMM-based learning of sequential user profiles showed lower performances than when both sequential preferences and sequential user profiles are learned.

The source codes related to the experiments conducted in *Movielens-100K* and *Movielens-1M* were exclusively written in C language, since no particular optimization was required due to the reasonable sizes of these datasets. Only the feature vector computation (including the HMM training) was written in C language for the experiments conducted in *Movielens-20M*. The remaining steps of the proposed system were implemented in Python language which offers various optimizing data structures (e.g., dictionaries, lists, sets, counters, tuples, heaps, etc.) that contributed to the reduction of the experimental time cost. All the experimental source codes and data supporting the findings of the current study are available online.<fnref n="32" />,<fnref n="33" />

## B. EXPERIMENTAL SETTINGS

Top-*n* recommendation experiments with $n \in \{10, 20\}$ were conducted under the system MS Windows 10 Professional edition on a personal computer having 16 GB of main memory and the following processor: Intel(R) Core(TM) i7-8665U CPU @ 1.90 GHz 2.11 GHz. Five separated experiments {$e_1, ..., e_5$} were conducted for each value of *n*. During each experiment $e_k$, the values ($T_{max}=\bar{T}_{max}=20 \times k$) were selected, with ($1 \le k \le 5$). The constant ($\gamma = 50$) was selected as the maximum number of iterations of the *Baum-Welch* algorithm [58]²⁶ and the constant ($r = 100$) was selected during the computation of the stationary distribution of the models. The constant ($\epsilon = 1.0$) was selected to initialize the HMMs as described in Section IV-C3 following [66]<fnref n="34" /> and the constant ($\epsilon=10^{-150}$) was selected during the computation of the importance of each movie using Equation 11. The KNN algorithm was

<footnote n="32">³²https://webperso.etis-lab.fr/sylvain.iloga/index.html</footnote>

<footnote n="33">³³https://github.com/HmmsMovieRecoms/HMMs-Movie-Recommendation</footnote>

<footnote n="34">³⁴See Section IV-C-III of [66].</footnote>
<table><caption>TABLE 18. Samplings for the scores and for some movie features in *Movielens-1M*.</caption><thead><tr><th>Symbol</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th></tr></thead><tbody><tr><th>Score</th><td>[0, 1.0]</td><td>[1.0, 2.0]</td><td>[2.0, 3.0]</td><td>[3.0, 4.0]</td><td>&gt; 4.0</td></tr><tr><th>Release date</th><td>&le;1979</td><td>[1980, 1985]</td><td>[1986, 1990]</td><td>[1991, 1995]</td><td>[1996, 2000]</td></tr><tr><th>Vote average</th><td>[0, 0.5]</td><td>[0.5, 1.0]</td><td>[1.0, 1.5]</td><td>[1.5, 2.0]</td><td>[2.0, 2.5]</td></tr><tr><th>Vote count</th><td>[0, 10]</td><td>[11, 50]</td><td>[51, 100]</td><td>[101, 250]</td><td>[251, 500]</td></tr></tbody></table>

<table><caption>TABLE 19. Samplings for the scores and for some movie features in *Movielens-20M*.</caption><thead><tr><th>Symbol</th><th>6</th><th>7</th><th>8</th><th>9</th><th>10</th></tr></thead><tbody><tr><th>Release date</th><td>[2001, 2005]</td><td>[2006, 2010]</td><td>[2011, 2015]</td><td>[2016, 2020]</td><td>&ge;2021</td></tr><tr><th>Vote average</th><td>[2.5, 3.0]</td><td>[3.0, 3.5]</td><td>[3.5, 4.0]</td><td>[4.0, 4.5]</td><td>&gt; 4.5</td></tr><tr><th>Vote count</th><td>[501, 1000]</td><td>[1001, 1500]</td><td>[1501, 2000]</td><td>[2001, 2500]</td><td>&ge;2501</td></tr></tbody></table>

<table><thead><tr><th>Symbol</th><th>1</th><th>2</th><th>3</th><th>4</th><th>5</th></tr></thead><tbody><tr><th>Score</th><td>[0, 1.0]</td><td>[1.0, 2.0]</td><td>[2.0, 3.0]</td><td>[3.0, 4.0]</td><td>&gt; 4.0</td></tr><tr><th>Release date</th><td>&le;1979</td><td>[1980, 1985]</td><td>[1986, 1990]</td><td>[1991, 1995]</td><td>[1996, 2000]</td></tr><tr><th>Vote average</th><td>[0, 0.5]</td><td>[0.5, 1.0]</td><td>[1.0, 1.5]</td><td>[1.5, 2.0]</td><td>[2.0, 2.5]</td></tr><tr><th>Vote count</th><td>[0, 2500]</td><td>[2501, 5000]</td><td>[5001, 10000]</td><td>[10001, 15000]</td><td>[15001, 20000]</td></tr></tbody></table>

<table><thead><tr><th>Symbol</th><th>6</th><th>7</th><th>8</th><th>9</th><th>10</th></tr></thead><tbody><tr><th>Release date</th><td>[2001, 2005]</td><td>[2006, 2010]</td><td>[2011, 2015]</td><td>[2016, 2020]</td><td>&ge;2021</td></tr><tr><th>Vote average</th><td>[2.5, 3.0]</td><td>[3.0, 3.5]</td><td>[3.5, 4.0]</td><td>[4.0, 4.5]</td><td>&gt; 4.5</td></tr><tr><th>Vote count</th><td>[20001, 25000]</td><td>[25001, 30000]</td><td>[30001, 40000]</td><td>[40001, 50000]</td><td>&ge;50001</td></tr></tbody></table>

initially executed with the *Euclidean* and with the *Manhattan* distances for $K \in \{10, 20, 30, 40, 50\}$ neighbors. These experiments demonstrated that the best performances were observed when ($K=50$) in *Movielens-100K*, when ($K=30$) in *Movielens-1M* and when ($K=20$) in *Movielens-20M*. These experiments also revealed that the performances with the *Manhattan* distance were always slightly better than those obtained with the *Euclidean* distance. Consequently, only the performances obtained with the *Manhattan* distance are reported in this section. The *QuickSort* algorithm was used in Algorithm 1 in order to reduce the time cost.

### C. SELECTED MOVIE AND USER FEATURES

The set $F = \{f_1, f_2, f_3, f_4\}$ containing the four movie features appearing in Table 2, as well as the set $G = \{f_5, f_6, f_7, f_8\}$ containing the four user features appearing in Table 7 have been selected here for the two experimental datasets. The vote averages and the vote counts of the movies that were initially unavailable in the two experimental datasets have been calculated here according to the content of each dataset.

The content of $F$ and $G$ was exclusively constrained by the attributes that were effectively available in the original datasets, specifically within the files encoding descriptive information about movies and users. Except the *vote count* and the *vote average* that were not explicitly provided in the original dataset files, no additional feature that was not present in the original dataset files was experimented. Nevertheless, in the case the proposed approach is applied to a dataset containing other numeric features (e.g., *runtime*, *budget*, etc.), these features can be handled via suitable sampling or clustering rules regarding the statistical content of the considered dataset. The integration of such additional

<table><caption>TABLE 20. Clustering rules for the genre in *Movielens-1M*.</caption><thead><tr><th>Frequency</th><th>Cluster</th></tr></thead><tbody><tr><td>&ge;700</td><td>1</td></tr><tr><td>[400, 700]</td><td>2</td></tr><tr><td>[200, 400]</td><td>3</td></tr><tr><td>[100, 200]</td><td>4</td></tr><tr><td>&lt; 100</td><td>5</td></tr></tbody></table>

features would probably enable making finer recommendations.

All the samplings and clustering rules proposed in Tables 3, 5, 8, 10 and 12 have been preserved during the experiments in *Movielens-100K*. Table 18 and Tables 20 to 23 contain the samplings and clustering rules used during the experiments in *Movielens-1M*. Tables 19 and 24 contain the samplings and clustering rules used during the experiments in *Movielens-20M*.

### D. ACCURACY METRICS OF EVALUATION

A good metric generally used for evaluating a RS is the *F1-score* [67]<fnref n="35" /> of the system which is computed as the harmonic mean between the *precision* of the system and the *recall* of the system. All these three metrics return real numbers belonging to [0, 1], their best value being 1. Given a user *u* who watched a sequence $X_u$ of relevant movies, the *precision* $Prec(u)$ of *u* measures how well the proposed approach puts relevant movies watched by *u* in the list $N_G^F(u)$ containing the first *n* movies recommended to *u*, regardless of the ranking of these movies. The *recall* $Rec(u)$ of *u* rather measures the proportion

<footnote n="35">³⁵See Equation 3 of [67].</footnote>
<table><caption>TABLE 21. Sampling used for the age range in *Movielens-1M*.</caption><thead><tr><td>Value</td><td>Symbol</td></tr></thead><tbody><tr><td>1</td><td>1</td></tr><tr><td>18</td><td>2</td></tr><tr><td>25</td><td>3</td></tr><tr><td>35</td><td>4</td></tr><tr><td>45</td><td>5</td></tr><tr><td>50</td><td>6</td></tr><tr><td>56</td><td>7</td></tr></tbody></table>

<table><caption>TABLE 22. Clustering rules for the occupation in *Movielens-1M*.</caption><thead><tr><td>Frequency</td><td>Cluster</td></tr></thead><tbody><tr><td>[0, 50]</td><td>1</td></tr><tr><td>[51, 100]</td><td>2</td></tr><tr><td>[101, 200]</td><td>3</td></tr><tr><td>[201, 300]</td><td>4</td></tr><tr><td>[301, 400]</td><td>5</td></tr><tr><td>[401, 600]</td><td>6</td></tr><tr><td>≥601</td><td>7</td></tr></tbody></table>

<table><caption>TABLE 23. Clustering rules for the zip code in *Movielens-1M*.</caption><thead><tr><td>Frequency</td><td>Cluster</td></tr></thead><tbody><tr><td>[0, 400]</td><td>1</td></tr><tr><td>[401, 500]</td><td>2</td></tr><tr><td>[501, 700]</td><td>3</td></tr><tr><td>≥701</td><td>4</td></tr></tbody></table>

of relevant movies watched by *u* that are found in $N_G^F(u)$ with respect to the total number of relevant movies watched by *u*, regardless of the ranking of these movies. The precision $Prec(\mathcal{U})$ and the recall $Rec(\mathcal{U})$ of the system are respectively the arithmetic means of the precisions and the recalls of all the system users as described in Equation 16, which also shows how to compute the *F1-score* of the system.

$$ 
\left\{
\begin{array}{l}
\text{F1}(\mathcal{U}) = \frac{2.\text{Prec}(\mathcal{U}) \cdot \text{Rec}(\mathcal{U})}{\text{Prec}(\mathcal{U}) + \text{Rec}(\mathcal{U})} \quad \text{where} \\
\text{Prec}(\mathcal{U}) = \frac{1}{|\mathcal{U}|} \left( \sum_{u \in \mathcal{U}} \text{Prec}(u) \right) \quad \text{and} \\
\text{Rec}(\mathcal{U}) = \frac{1}{|\mathcal{U}|} \left( \sum_{u \in \mathcal{U}} \text{Rec}(u) \right) \quad \text{and} \\
\text{Prec}(u) = \frac{|N_G^F(u) \cap X_u|}{|N_G^F(u)|} \quad \text{and} \\
\text{Rec}(u) = \frac{|N_G^F(u) \cap X_u|}{|X_u|} \quad \text{and}
\end{array}
\right.
\qquad (16) $$

Many authors also compute the MAE and the RMSE for evaluating their systems, they both return positive real numbers and their best value is 0. In a context where the proposed system can predict the score attributed by each user to any movie, the RMSE evaluates the accuracy of the system by measuring the square root of the average squared differences between the predicted score $\bar{\alpha}^u(x)$ and the effective score $\alpha^u(x)$ attributed by every user $u$ to each movie

<table><caption>TABLE 24. Clustering rules for the genre in *Movielens-20M*.</caption><thead><tr><td>Frequency</td><td>Cluster</td></tr></thead><tbody><tr><td>≥7000</td><td>1</td></tr><tr><td>[3000, 7000]</td><td>2</td></tr><tr><td>[2000, 3000]</td><td>3</td></tr><tr><td>[1300, 2000]</td><td>4</td></tr><tr><td>[1000, 1300]</td><td>5</td></tr><tr><td>&lt; 1000</td><td>6</td></tr></tbody></table>

*x* of his sequence $X_u$ of watched movies. The MAE measures the average of the absolute values of the differences between the predicted scores and the effective scores. Equation 17 shows how to compute these metrics.

In the specific context of Top-*n* recommendation where the ranking of the recommended movies is important, the NDCG stands as a suitable ranking quality metric which returns a real number belonging to [0, 1], its best value is 1. It measures how well the predicted ranking of the recommended movies matches the ideal ranking based on the relevance *rel(y)* of each recommended movie *y*. In the proposed system, this relevance is the score $\alpha^u(y)$ effectively attributed by a user *u* to a recommended movie *y*. When *y* is not among the movies watched by *u*, it is the predicted score $\bar{\alpha}^u(y)$ that is rather considered as the relevance of *y*. The NDCG of the system noted NDCG($\mathcal{U}$) is computed in Equation 18 as the arithmetic mean of the NDCG of all the system users. In that equation, NDCG($\mathcal{U}$) is the NDCG of each user $u$, $y_k^u$ is the $k^{th}$ movie from the original list of movies recommended to $u$, and $z_k^u$ is the $k^{th}$ movie from the list of movies recommended to $u$ sorted in the descending order of their relevance. All the metrics presented in this section were selected for evaluating the proposed system.

$$ 
\left\{
\begin{array}{l}
\text{RMSE}(\mathcal{U}) = \sqrt{\frac{r_1}{r_3}} \quad \text{and} \\
\text{MAE}(\mathcal{U}) = \frac{r_2}{r_3} \quad \text{where} \\
r_1 = \sum_{u \in \mathcal{U}} \left( \sum_{x \in X_u} (\alpha^u(x) - \bar{\alpha}^u(x))^2 \right) \quad \text{and} \\
r_2 = \sum_{u \in \mathcal{U}} \left( \sum_{x \in X_u} |\alpha^u(x) - \bar{\alpha}^u(x)| \right) \quad \text{and} \\
r_3 = \sum_{u \in \mathcal{U}} |X_u|
\end{array}
\right.
\qquad (17) $$

$$ 
\left\{
\begin{array}{l}
\text{NDCG}(\mathcal{U}) = \frac{1}{|\mathcal{U}|} \left( \sum_{u \in \mathcal{U}} \text{NDCG}(u) \right) \quad \text{where} \\
\text{NDCG}(u) = \frac{\text{DCG}(u)}{\text{IDCG}(u)} \quad \text{and} \\
\text{DCG}(u) = \sum_{k=1}^{n} \frac{2^{\text{rel}(y_k^u)} - 1}{\log_2(k + 1)} \quad \text{and} \\
\text{IDCG}(u) = \sum_{k=1}^{n} \frac{2^{\text{rel}(z_k^u)} - 1}{\log_2(k + 1)}
\end{array}
\right.
\qquad (18) $$
The experimental datasets were not partitioned into distinct training, validation, and test subsets due to the independence of the learning processes. Indeed, the HMMs trained for a given user *u* do not depend on data related to any other system user. Only the handcrafted features of his *T*<sub>max</sub> most recently watched movies (i.e. release date, vote average, vote count, genres), alongside with the corresponding votes are required for constructing the MCs associated with *u*, then for training his associated HMMs. Similarly, the HMMs trained for a given movie *x* do not depend on data related to any other system movie. Only the handcrafted features of its *T*<sub>max</sub> most recent viewers (i.e. age, gender, occupation, zip-code), alongside with the corresponding votes are required for constructing the MCs associated with *x*, then for training its associated HMMs. As a consequence, performance evaluation was conducted in the current work on the entire datasets.

More specifically, for each system user, individual pre-
cision, recall and NDCG were initially independently com-
puted. The corresponding global system evaluation metrics
were subsequently obtained by averaging these user-level
results. The global system RMSE and MAE were computed
by first calculating the error (squared error for RMSE,
absolute error for MAE) between the predicted score and the
true score for each valid pair user-movie in the system, then
the average of these errors across all the system users and their
rated movies is taken. The RMSE is obtained by taking the
square root of this average of squared errors, while the MAE
is obtained by taking the mean of absolute errors directly.

E. EXPERIMENTAL PERFORMANCES

The experimental performances of the proposed system in
the three experimental datasets, during the five experiments
{e₁, ..., e₅} conducted for the Top-10 and the Top-20 recom-
mendation are presented in Table 25. The content of that table
demonstrates the accuracy of the proposed system which
exhibited good values for all the selected metrics. Indeed:

1) In *Movielens-100K*, a very good best precision of 0.997 and a high best recall of 0.850 were observed. The best F1 score was 0.850, accompanied with a very good best NDCG of 0.942. The best RMSE and MAE were respectively 0.01530 and 0.00036 which are very low values. The very good performances of the proposed system in *Movielens-100K* are tightly related to its small size.

2) In *Movielens-1M*, the proposed system showed a best NDCG of 0.923 while the same good value 0.514 was observed as best precision, recall and F1 score. The best RMSE and MAE were respectively 0.345 and 0.108. These values are lower than those observed in *Movielens-100K*, but they still remain good values regarding the relatively large size of *Movielens-1M*.

3) In *Movielens-20M*, although the sequential user profiles were not learned, the proposed system showed a good best precision of 0.513, while the same good value 0.466 was observed as best recall and best F1 score.

The best NDCG was 0.940, which is of the same order
of magnitude as those observed in *Movielens-100K*
and in *Movielens-1M*. The best RMSE and MAE were
respectively 0.212 and 0.054, these values are very low
when the huge size of *Movielens-20M* is considered.

For completeness, the standard deviation of all evaluation
metrics is also computed across runs. These results are
available in our released source code, but are not included
in Table 25 due to space constraints and to enable a good
readability of the paper.

F. EXPERIMENTAL TIME COST

Table 26 reports the minimum and maximum durations observed for the following main computational stages of the proposed framework across all experiments on each dataset:

1) *Data access*: extraction of the user features and the user ratings from the dataset.

2) *Movie vector*: computation of all the movie vectors, this includes the HMMs training (except for *Movielens-20M*).

3) *User vector*: computation of all the user vectors, this includes the HMMs training.

4) KNN: the KNN algorithm (line 1 of Algorithm 1).

5) *Recommendation*: the remaining lines of Algorithm 1.

The results indicate that the overall runtime remains
moderate for small-scale and medium-scale datasets such
as *Movielens-100K* and *Movielens-1M*. However, the com-
putation of the movie and user vectors, both of which
involve HMM training, becomes time-consuming when the
dataset size increases, as it is the case for *Movielens-20M*.
The KNN stage shows an approximately linear increase in
runtime as the number of movies and users grows, while the
recommendation stage shows the dominant time cost in these
same conditions.

Although the various steps of the proposed framework become time-consuming for large-scale datasets, their computational complexity remains manageable through standard optimizations. In particular, parallelized HMM training or approximate nearest-neighbors search techniques could substantially reduce the total runtime without compromising recommendation accuracy.

Overall, the experimental results demonstrate that the pro-
posed method exhibits acceptable scalability characteristics,
with most of the time cost concentrated in the user/movie
representation and recommendation stages.

G. COMPARISON TO EXISTING WORK

1) EXPERIMENTAL COMPARISON

The best performances of the proposed approach have
been compared to those of the existing studies reviewed
in Table 1 that were experimented in *Movielens-100K*,
in *Movielens-1M* and in *Movielens-20M*. The compari-
son results presented in Table 27 demonstrate that the
proposed approach significantly outperforms all these
<table><caption>TABLE 25. Performances of the proposed system. The Manhattan distance is the vector distance. The best values are in bold.</caption><caption>(a)- In Movielens-100K with (K=50)</caption><thead><tr><th>Top</th><th>T<sub>max</sub></th><th>T&#773;<sub>max</sub></th><th>Prec(U)</th><th>Rec(U)</th><th>F1(U)</th><th>RMSE(U)</th><th>MAE(U)</th><th>NDCG(U)</th></tr></thead><tbody><tr><td rowspan="5">10</td><td>20</td><td>20</td><td>0.987</td><td>0.494</td><td>0.658</td><td><strong>0.01530</strong></td><td><strong>0.00036</strong></td><td>0.903</td></tr><tr><td>40</td><td>40</td><td>0.993</td><td>0.290</td><td>0.449</td><td>0.02357</td><td>0.00068</td><td>0.922</td></tr><tr><td>60</td><td>60</td><td>0.994</td><td>0.240</td><td>0.387</td><td>0.02476</td><td>0.00068</td><td>0.930</td></tr><tr><td>80</td><td>80</td><td>0.995</td><td>0.221</td><td>0.361</td><td>0.02468</td><td>0.00065</td><td>0.940</td></tr><tr><td>100</td><td>100</td><td>0.996</td><td>0.210</td><td>0.348</td><td>0.02619</td><td>0.00072</td><td><strong>0.942</strong></td></tr><tr><td rowspan="5">20</td><td>20</td><td>20</td><td>0.850</td><td><strong>0.850</strong></td><td><strong>0.850</strong></td><td><strong>0.01530</strong></td><td><strong>0.00036</strong></td><td>0.890</td></tr><tr><td>40</td><td>40</td><td>0.994</td><td>0.580</td><td>0.733</td><td>0.02357</td><td>0.00068</td><td>0.908</td></tr><tr><td>60</td><td>60</td><td>0.996</td><td>0.480</td><td>0.648</td><td>0.02476</td><td>0.00068</td><td>0.916</td></tr><tr><td>80</td><td>80</td><td>0.996</td><td>0.441</td><td>0.611</td><td>0.02468</td><td>0.00065</td><td>0.925</td></tr><tr><td>100</td><td>100</td><td><strong>0.997</strong></td><td>0.420</td><td>0.591</td><td>0.02619</td><td>0.00072</td><td>0.929</td></tr></tbody></table>

<table><caption>(b)- In Movielens-1M with (K=30)</caption><thead><tr><th>Top</th><th>T<sub>max</sub></th><th>T&#773;<sub>max</sub></th><th>Prec(U)</th><th>Rec(U)</th><th>F1(U)</th><th>RMSE(U)</th><th>MAE(U)</th><th>NDCG(U)</th></tr></thead><tbody><tr><td rowspan="5">10</td><td>20</td><td>20</td><td>0.459</td><td>0.230</td><td>0.306</td><td><strong>0.345</strong></td><td><strong>0.108</strong></td><td>0.876</td></tr><tr><td>40</td><td>40</td><td>0.326</td><td>0.090</td><td>0.141</td><td>0.410</td><td>0.153</td><td>0.886</td></tr><tr><td>60</td><td>60</td><td>0.234</td><td>0.053</td><td>0.086</td><td>0.453</td><td>0.185</td><td>0.898</td></tr><tr><td>80</td><td>80</td><td>0.192</td><td>0.041</td><td>0.068</td><td>0.487</td><td>0.211</td><td>0.915</td></tr><tr><td>100</td><td>100</td><td>0.173</td><td>0.036</td><td>0.060</td><td>0.509</td><td>0.230</td><td><strong>0.923</strong></td></tr><tr><td rowspan="5">20</td><td>20</td><td>20</td><td><strong>0.514</strong></td><td><strong>0.514</strong></td><td><strong>0.514</strong></td><td><strong>0.345</strong></td><td><strong>0.108</strong></td><td>0.843</td></tr><tr><td>40</td><td>40</td><td>0.481</td><td>0.264</td><td>0.341</td><td>0.410</td><td>0.153</td><td>0.835</td></tr><tr><td>60</td><td>60</td><td>0.407</td><td>0.178</td><td>0.248</td><td>0.453</td><td>0.185</td><td>0.836</td></tr><tr><td>80</td><td>80</td><td>0.353</td><td>0.143</td><td>0.204</td><td>0.487</td><td>0.211</td><td>0.840</td></tr><tr><td>100</td><td>100</td><td>0.319</td><td>0.126</td><td>0.181</td><td>0.509</td><td>0.230</td><td>0.847</td></tr></tbody></table>

<table><caption>TABLE 26. Experimental time cost of the proposed system. Durations are reported in seconds.</caption><caption>(c)- In Movielens-20M with (K=20)</caption><thead><tr><th>Top</th><th>T<sub>max</sub></th><th>T&#773;<sub>max</sub></th><th>Prec(U)</th><th>Rec(U)</th><th>F1(U)</th><th>RMSE(U)</th><th>MAE(U)</th><th>NDCG(U)</th></tr></thead><tbody><tr><td rowspan="5">10</td><td>20</td><td>—</td><td>0.509</td><td>0.254</td><td>0.339</td><td>0.264</td><td>0.085</td><td><strong>0.940</strong></td></tr><tr><td>40</td><td>—</td><td><strong>0.513</strong></td><td>0.151</td><td>0.233</td><td>0.378</td><td>0.175</td><td>0.914</td></tr><tr><td>60</td><td>—</td><td>0.508</td><td>0.126</td><td>0.202</td><td>0.425</td><td>0.223</td><td>0.911</td></tr><tr><td>80</td><td>—</td><td>0.508</td><td>0.117</td><td>0.190</td><td>0.448</td><td>0.247</td><td>0.913</td></tr><tr><td>100</td><td>—</td><td>0.505</td><td>0.111</td><td>0.182</td><td>0.458</td><td>0.259</td><td>0.914</td></tr><tr><td rowspan="5">20</td><td>20</td><td>—</td><td>0.466</td><td><strong>0.466</strong></td><td><strong>0.466</strong></td><td><strong>0.212</strong></td><td><strong>0.054</strong></td><td>0.936</td></tr><tr><td>40</td><td>—</td><td>0.508</td><td>0.298</td><td>0.375</td><td>0.310</td><td>0.116</td><td>0.907</td></tr><tr><td>60</td><td>—</td><td>0.499</td><td>0.246</td><td>0.329</td><td>0.363</td><td>0.160</td><td>0.900</td></tr><tr><td>80</td><td>—</td><td>0.494</td><td>0.226</td><td>0.310</td><td>0.393</td><td>0.188</td><td>0.900</td></tr><tr><td>100</td><td>—</td><td>0.490</td><td>0.216</td><td>0.300</td><td>0.411</td><td>0.206</td><td>0.900</td></tr></tbody></table>

<table><thead><tr><th rowspan="2"></th><th colspan="2">Movielens-100K</th><th colspan="2">Movielens-1M</th><th colspan="2">Movielens-20M</th></tr><tr><th>Min</th><th>Max</th><th>Min</th><th>Max</th><th>Min</th><th>Max</th></tr></thead><tbody><tr><td>Data access</td><td>0.41</td><td>0.43</td><td>11.29</td><td>11.60</td><td>29.42</td><td>30.24</td></tr><tr><td>Movie vector</td><td>1.71</td><td>2.4</td><td>4.17</td><td>6.09</td><td>0.04</td><td>0.08</td></tr><tr><td>User vector</td><td>0.91</td><td>1.36</td><td>5.76</td><td>10.68</td><td>449.83</td><td>495.44</td></tr><tr><td>KNN</td><td>0.20</td><td>0.21</td><td>9.91</td><td>10.64</td><td>60.79</td><td>63.92</td></tr><tr><td>Recommendation</td><td>0.81</td><td>3.54</td><td>5.39</td><td>43.72</td><td>339.52</td><td>1122.77</td></tr></tbody></table>

existing studies for all the selected accuracy metrics of evaluation.

## 2) COMPARISON TO SEQUENTIAL RSS

Existing sequential RSs are *discriminative* and *representation-learning based*. They are discriminative because they directly learn to model the conditional probability of the next user interaction (e.g., the next movie to watch) given the past

sequence, rather than explicitly generating entire interaction sequences from a probabilistic generative process. They are also considered representation-learning based because they focus on automatically learning low-dimensional vector representations (e.g., embeddings, functions) that map past interactions to next-movie predictions, instead of relying on user/movie handcrafted features or rules. For these reasons, existing sequential RSs are highly flexible and accurate.
However, they are also time consuming because they mostly rely on deep models, while relying heavily on having sufficient data to learn effective representations.

Conversely, the HMMs that are used in the current work are probabilistic<fnref n="36" /> and generative<fnref n="37" /> models. They are probabilistic because they explicitly define probability distributions over both the hidden states (interactions = ratings) and the emitted symbols (user/movie handcrafted features), allowing them to reason about uncertainty in the user behavior. They are also generative because they model the joint probability distribution of sequences by specifying how hidden states probabilistically transit over time and how each state probabilistically generates a symbol.<fnref n="38" /> This means that, in principle, the proposed RSs can be integrated into a generative artificial intelligence system for generating entire user or movie sequences that are statistically consistent with the learned model, rather than just predicting the next movie to watch. As a consequence, the proposed HMM-based approach is interpretable and well-suited for handling noisy or incomplete data. But this technique can become time consuming for large datasets and is also less expressive than existing sequential techniques for capturing complex dependencies. Table 28 summarizes the key points of the conceptual comparison between the proposed technique and the existing sequential techniques.

### 3) COMPARISON TO HYBRID NON-SEQUENTIAL RSS

Traditional hybrid non-sequential RSs combine CF and CBF primarily through deterministic models such as similarity-based, feature-augmented or factorization-based techniques. In these approaches, interactions are treated as unordered events, meaning they capture *what* users have interacted with but not *when* or *in what order*. This makes them computationally efficient and relatively easy to scale to very large datasets. Feature usage is often straightforward because user and movie features are embedded as auxiliary input variables to enhance prediction accuracy, they are also sometimes used for post-filtering the recommendation results. These systems are generally simple to train and easy to deploy, while having moderate interpretability because latent factors (e.g., unobserved or inferred features) often remain abstract. The risk of overfitting is usually moderate in these systems since their number of hyperparameters is relatively small.

In contrast, the proposed hybrid HMM-based RS explicitly incorporates sequential modeling on both the user side and the movie side. This sets it apart from most non-sequential existing hybrid systems. By representing users as sequences of their $T_{max}$ most recently watched movies and movies as sequences of their $\bar{T}_{max}$ most recent viewers, the system can capture not only who interacts with what, but also how preferences evolve over time and how audience composition

shifts. The model type is probabilistic and generative, relying on HMMs where user ratings act as hidden states and user features act as observed emissions. This allows it to learn temporal dynamics and provide highly interpretable descriptors. However, this modeling approach is computationally heavier because the HMM training can become expensive as the number of users/movies, or the sequence lengths ($T_{max}$ and $\bar{T}_{max}$) grow. Scalability may therefore be challenging for very large datasets in terms of the time cost. Nevertheless, approximations or parallelization strategies can be used for reducing the time cost in such cases. Overfitting risk can also be large due to the high number of hyperparameters. Table 29 summarizes the key points of the conceptual comparison between the proposed techniques and the existing hybrid non-sequential techniques.

## H. MAIN ASSETS

Given a user *u* and a movie *x*, the technique proposed in the current work:

1) Characterizes *u* by the chronological sequence of movies he watched in order to generate a unique numeric feature vector $\vec{u}_F$ whose components are interpretable, according to a set *F* of movie features. No existing technique can do this.

2) Characterizes *x* by the chronological sequence of users who watched it in order to generate a unique numeric feature vector $\vec{x}_G$ whose components are also interpretable, according to a set *G* of user features. No existing technique can do this.

3) Accurately predicts the score $\bar{\alpha}^t(x)$ that might be attributed to *x* by *u* regardless of whether *u* has effectively watched *x* or not.

4) Only relies on the $T_{max}$ most recent movies watched by each user and the profiles of the $\bar{T}_{max}$ most recent viewers of each movie to make recommendation.

5) Reduces the cognitive load of *u* during the exploration of the recommended movies through the evaluation of the importance of each recommended movie in the neighborhood of *u*.

6) Significantly outperforms the existing work experienced on the datasets *Movielens-100K*, *Movielens-1M* and *Movielens-20M* regarding the precision, the recall, the F1-score, the RMSE, the MAE and the NDCG.

## I. SENSITIVITY TO HYPERPARAMETERS

The proposed approach is highly customizable according to several user-defined hyperparameters (e.g., sampling bins, number of clusters, $T_{max}$, $\bar{T}_{max}$, number of HMM states, $\gamma$, $r$, $K$, $K_1$, $K_2$, $t_{max}$, $\bar{t}_{max}$, $\varepsilon$ and $\epsilon$) whose variations may affect the experimental performances. It is consequently important to analyze the sensitivity of the proposed approach to these hyperparameters.

The tuning recommendations for the hyperparameters $K_1$, $K_2$, $t_{max}$ and $\bar{t}_{max}$ have already been motivated in

<footnote n="36">³⁶See Section III-A of the current work.</footnote>

<footnote n="37">³⁷See Section III-B of the current work.</footnote>

<footnote n="38">³⁸See Figure 3 of the current work.</footnote>
<table><caption>TABLE 27. Comparison of the best performances of the current work to those of the existing studies. The best values are in bold.</caption><caption>(a) In Movielens-100K</caption><thead><tr><th>Authors[Ref]</th><th>Year</th><th>RMSE</th><th>MAE</th><th>Prec</th><th>Rec</th><th>F1</th><th>NDCG</th></tr></thead><tbody><tr><td>Badaro & Wassim [31]</td><td>2013</td><td>—</td><td>0.6</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr><td>Xue et al. [34]</td><td>2017</td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td><td>0.409</td></tr><tr><td>Valdiviezo & Bobadilla [33]</td><td>2019</td><td>—</td><td>0.7198</td><td>0.8704</td><td>0.1067</td><td>0.190</td><td>—</td></tr><tr><td>Mohammed F. et al. [10]</td><td>2020</td><td>0.917</td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr><td>Mohammed F. et al. [11]</td><td>2020</td><td>0.931</td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr><td>Barathy F. et al. [12]</td><td>2020</td><td>0.9646</td><td>0.9490</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr><td>Maaruf & Zhihong [13]</td><td>2020</td><td>—</td><td>0.712</td><td>0.7682</td><td>—</td><td>—</td><td>—</td></tr><tr><td>Anwar & Uma [14]</td><td>2021</td><td>0.9201</td><td>0.7219</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr><td>Behera & Nain [15]</td><td>2023</td><td>0.9119</td><td>0.7084</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr><td>Sonu & Agrawal [45]</td><td>2023</td><td>0.9537</td><td>0.7460</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr><td><strong>This work</strong></td><td>2025</td><td><strong>0.01530</strong></td><td><strong>0.00036</strong></td><td><strong>0.997</strong></td><td><strong>0.850</strong></td><td><strong>0.850</strong></td><td><strong>0.942</strong></td></tr></tbody></table>

<table><caption>(b) In Movielens-1M</caption><thead><tr><th>Authors[Ref]</th><th>Year</th><th>RMSE</th><th>MAE</th><th>Prec</th><th>Rec</th><th>F1</th><th>NDCG</th></tr></thead><tbody><tr><td>Lekakos & Caravelas [30]</td><td>2008</td><td>—</td><td>0.7501</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr><td>J. Son & Seoung [26]</td><td>2017</td><td>—</td><td>—</td><td><strong>0.73</strong></td><td>0.1</td><td>0.176</td><td>—</td></tr><tr><td>Kang & McAuley [19]</td><td>2018</td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td><td>0.5905</td></tr><tr><td>Tang, Wang & Liu [21]</td><td>2018</td><td>—</td><td>—</td><td>0.1991</td><td>0.1121</td><td>0.1434</td><td>—</td></tr><tr><td>Haradl & Steck [8]</td><td>2019</td><td>—</td><td>—</td><td>0.216</td><td>0.289</td><td>0.247</td><td>0.335</td></tr><tr><td>Zhang & Mao [9]<sup>36</sup></td><td>2019</td><td>0.90</td><td>—</td><td><strong>0.73</strong></td><td>—</td><td>—</td><td>—</td></tr><tr><td>Mohammed F. et al. [10]</td><td>2020</td><td>0.903</td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr><td>Mohammed F. et al. [11]</td><td>2020</td><td>0.881</td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr><td>Behera & Nain [15]</td><td>2023</td><td>0.8528</td><td>0.6683</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr><td>Sonu & Agrawal [45]</td><td>2023</td><td>0.9064</td><td>0.7102</td><td>—</td><td>—</td><td>—</td><td>—</td></tr><tr><td><strong>This work</strong></td><td>2025</td><td><strong>0.345</strong></td><td><strong>0.108</strong></td><td><strong>0.514</strong></td><td><strong>0.514</strong></td><td><strong>0.514</strong></td><td><strong>0.847</strong></td></tr></tbody></table>

<table><caption>TABLE 28. Conceptual comparison to the existing sequential techniques.</caption><caption>(c) In Movielens-20M</caption><thead><tr><th>Authors[Ref]</th><th>Year</th><th>RMSE</th><th>MAE</th><th>Prec</th><th>Rec</th><th>F1</th><th>NDCG</th></tr></thead><tbody><tr><td>Chen et al. [25]</td><td>2017</td><td>—</td><td>—</td><td>0.0798</td><td>—</td><td>—</td><td>—</td></tr><tr><td>Yashar et al. [32]</td><td>2018</td><td>—</td><td>—</td><td>—</td><td>0.0067</td><td>—</td><td>—</td></tr><tr><td>Zhang & Mao [9]</td><td>2019</td><td>0.88</td><td>—</td><td>0.33</td><td>—</td><td>—</td><td>—</td></tr><tr><td>Sun et al. [28]</td><td>2019</td><td>—</td><td>—</td><td>—</td><td>—</td><td>—</td><td>0.5340</td></tr><tr><td>Petrov & Macdonald [24]</td><td>2024</td><td>—</td><td>—</td><td>—</td><td>0.188</td><td>—</td><td>0.1968</td></tr><tr><td><strong>This work</strong></td><td>2025</td><td><strong>0.212</strong></td><td><strong>0.054</strong></td><td><strong>0.513</strong></td><td><strong>0.466</strong></td><td><strong>0.466</strong></td><td><strong>0.940</strong></td></tr></tbody></table>

<table><caption>TABLE 29. Conceptual comparison to the existing hybrid non-sequential techniques.</caption><thead><tr><th>Aspect</th><th>Existing sequential RSs</th><th>This work</th></tr></thead><tbody><tr><td>Data</td><td>Interactions</td><td>Interactions (ratings) &amp; handcrafted features</td></tr><tr><td>Models</td><td>Deep models &amp; Linear algebra</td><td>HMMs</td></tr><tr><td>Model type</td><td>Discriminative &amp; Rep.-learning based</td><td>Probabilistic &amp; Generative</td></tr><tr><td>Advantages</td><td>Flexible &amp; Accurate</td><td>Interpretable &amp; Handles noisy or incomplete data</td></tr><tr><td>Limitations</td><td>Time consuming &amp; Needs sufficient data</td><td>Time consuming &amp; Unsuitable for complex data</td></tr></tbody></table>

<table><thead><tr><th>Aspect</th><th>Existing hybrid non-sequential RSs</th><th>This work</th></tr></thead><tbody><tr><td>Sequentiality</td><td>Not handled</td><td>Handled</td></tr><tr><td>Model type</td><td>Deterministic</td><td>Probabilistic &amp; Generative</td></tr><tr><td>Feature usage</td><td>Used as input variables or for post-filtering</td><td>Integrated as HMM probabilities</td></tr><tr><td>Time cost</td><td>Computationally efficient</td><td>Time consuming</td></tr><tr><td>Scalability</td><td>Easy to scale</td><td>Challenging for large datasets</td></tr><tr><td>Interpretability</td><td>Moderate</td><td>High</td></tr><tr><td>Overfitting risk</td><td>Moderate</td><td>High</td></tr></tbody></table>

Sections IV-E1 and IV-E2. The hyperparameters $\epsilon$ and $\epsilon$ are both exclusively used to avoid divisions by zero during the model initialization (in Equations 1 to 3) and during the computation of the importance of a movie (in Equation 11). They are therefore not intended to significantly impact the

underlying operations. For this reason, it is recommended to preserve the values ($\epsilon$ = 1.0) and ($\epsilon$ = $10^{-150}$) proposed in the current work for these parameters. Each remaining hyperparameter can be tuned through empirical
or *cross-validated* experiments. A more detailed analysis of the remaining parameters is available in the next sections.

### 1) SENSITIVITY TO THE SAMPLING BINS

The choice of the number of discrete bins used to sample continuous movie features (e.g., release date, vote average, vote count) and user features (e.g., age) critically affects the performances of the proposed HMM-based system because it directly controls the granularity of the observed symbols. A small value implies a coarse discretization, which risks losing important distinctions between movies or between users. This may lead to underfitting and to models that cannot capture meaningful temporal preference or profile patterns (e.g., treating all movies from 1980-2000 as similar). Conversely, a large value induces a fine discretization which increases the state-observation space. This allows the model to capture subtle differences between movies as well as between users, but at the cost of data sparsity because many bins might have few or no observations. Such conditions can degrade the HMM parameter estimation during the learning process and increase the risk of overfitting. In summary, the number of sampling bins should be adjusted to find a balance between expressiveness and statistical reliability. In the current work, the number of sampling bins was tuned according to the statistical content of each experimental dataset.

### 2) SENSITIVITY TO THE NUMBER OF CLUSTERS

The number of clusters used to group user features (e.g., user occupation) or movie features (e.g., movie genre) whose values belong to relatively large finite sets strongly influences the performances of proposed HMM-based RS because it determines how much information about feature distribution is preserved. A small number of clusters may oversimplify the feature space, merging for example very different occupations or genres into the same cluster. This causes loss of important behavioral or content distinctions, which can lead to underfitting. In contrast, a high number of clusters preserves finer-grained information, but increases the risk of creating clusters with very few samples leading to unreliable emission probabilities and potential overfitting. In summary, the number of clusters must be tuned to balance feature resolution and statistical robustness. In the current, the number of clusters was fixed according to the statistical content of each experimental dataset as it was the case for the number of sampling bins.

### 3) SENSITIVITY TO $T_{MAX}$

The selection of the number $T_{max}$ of the most recent movies watched by a user directly impacts the trade-off between capturing long-term against short-term user preferences in the proposed HMM-based system. A small $T_{max}$ focuses the model on very recently watched movies, which can better reflect a user's current taste. This increases the risk of ignoring older but still relevant preferences, leading to

narrow-sighted recommendations. However, a high value of $T_{max}$ allows the HMM to exploit a richer behavioral history, potentially improving personalization for users with diverse tastes, but it can also introduce noise by including outdated preferences. This increases the model complexity and may lead to overfitting when the data per user is sparse. In the current work, several values of $T_{max}$ (e.g., 20, 40, 60, 80, 100) were empirically tested. More generally, it is strongly recommended to rely on the density of the experimental dataset and on the expected stability of the user preferences to set the value of $T_{max}$.

### 4) SENSITIVITY TO $\bar{T}_{MAX}$

The choice of $\bar{T}_{max}$, which restricts the number of most recent viewers considered for each movie, directly determines how effectively the proposed HMM-based system captures evolving user profiles. A small $\bar{T}_{max}$ focuses only on the latest viewers, allowing the model to quickly adapt to recent trends (e.g., changes in the demographic profile of the system users) but potentially ignoring broader historical viewers. This may induce unstable or biased recommendations. In contrast, a large $\bar{T}_{max}$ incorporates a more comprehensive set of viewers, improving the robustness of the estimated emission probabilities and enhancing the ability of the model to capture long-term user preferences. But this might include outdated or less relevant profiles that could blur recent shifts in preferences. In summary, $\bar{T}_{max}$ should be adjusted to balance the need for adaptiveness to recent audience trends with the statistical stability of the learned sequences of user profiles. In the current work, many values of $\bar{T}_{max}$ (e.g., 20, 40, 60, 80, 100) were empirically tested as it was the case for $T_{max}$.

### 5) SENSITIVITY TO THE NUMBER OF STATES

The number of states of the HMMs designed in the proposed RS plays a crucial role in balancing model expressiveness and reliability. A small number of states collapses several rating levels into broad categories, reducing the model's ability to distinguish between nuanced user preferences (e.g., treating scores of 4.1 and 5.0 as equivalent). This can lead to underfitting and less personalized recommendations. However, a large number of states preserves more granularity in user preferences, but increases the state space. This may induce sparse transition counts, unreliable estimation of the model parameters during the learning process, and a higher risk of overfitting when data is limited. In summary, the number of states must be tuned to strike a balance between capturing meaningful rating differences and ensuring sufficient data per state for stable learning. In the current work, the number of states was empirically tuned to five.

### 6) SENSITIVITY TO $\gamma$

The maximum number $\gamma$ of iterations of the Baum-Welch algorithm determines the convergence quality and computational cost of the model. If $\gamma$ is too low, the learning process may stop before reaching a stable set of parameters, resulting
<table><caption>TABLE 30. Sensitivity of the proposed approach to its hyperparameters.</caption><thead><tr><th>Parameter</th><th>Small value</th><th>High value</th></tr></thead><tbody><tr><td>Sample bins</td><td>Underfitting &amp; Ignores meaningful patterns</td><td>Overfitting &amp; Data sparsity</td></tr><tr><td>Number of clusters</td><td>Underfitting &amp; Loss of important behavioral distinctions</td><td>Overfitting &amp; Unreliable emission probabilities</td></tr><tr><td>T<sub>max</sub></td><td>Ignores older relevant preferences &amp; Narrow-sighted recommendations</td><td>Overfitting &amp; Introduces noise &amp; time consuming</td></tr><tr><td>T&#773;<sub>max</sub></td><td>Ignores broader historical viewers &amp; Biased recommendations</td><td>Includes outdated profiles &amp; Blurs recent shifts in the preferences</td></tr><tr><td>Number of states</td><td>Underfitting &amp; Less personalized recommendations</td><td>Overfitting &amp; Unreliable learning process</td></tr><tr><td>γ</td><td>Undertrained model &amp; Harms the accuracy</td><td>Overfitting &amp; Time consuming</td></tr><tr><td>r</td><td>Inaccurate stationary distribution</td><td>Time consuming &amp; No accuracy improvement</td></tr><tr><td>K</td><td>Biased recommendations</td><td>Dilutes personalization &amp; Generic results</td></tr></tbody></table>

in an undertrained model, which can harm recommendation accuracy. Increasing $γ$ generally improves performances by allowing the model to refine its parameters over more iterations. But beyond a certain point, gains become marginal as the likelihood converges and additional iterations only increase the computation time without meaningful improvements. In some cases, too many iterations can even lead to overfitting, especially when the training data are noisy or sparse. In summary, $γ$ should be adjusted to balance training time and model performance. Hence, it is recommended to monitor the log-likelihood improvement between successive iterations and to stop early once convergence criteria are met. In the current work, the value ($γ$ = 50) was selected.

### 7) SENSITIVITY TO R

The maximum number $r$ of matrix products determines the accuracy of the resulting stationary distribution and consequently impacts the quality of the final feature vectors generated by the proposed system. This parameter should be chosen such that the difference between $A^r$ and $A^{(r-1)}$ falls below a small tolerance, indicating that the HMM has reached equilibrium. Choosing $r$ too small leads to an inaccurate stationary distribution that remains influenced by the initial state. Whereas, an excessively large value of $r$ only increases the computational cost without improving accuracy. In the current work, the value ($r$ = 100) was selected. It is recommended to select $r$ adaptively by iterating until convergence within a specified threshold rather than fixing it a priori.

### 8) SENSITIVITY TO K

The number $K$ of neighbors discovered by the KNN algorithm has a direct impact on both recommendation relevance and diversity. A small $K$ means that recommendations are based on a very limited set of similar users, which can produce highly personalized suggestions but also risks being noisy or biased if those few neighbors have atypical preferences. Conversely, increasing $K$ generally improves the robustness of recommendations and reduces the influence of outliers. However, this may include many weakly similar users, diluting personalization and leading to generic results. In summary, $K$ should be adjusted to balance personalization and stability. In the current work, various values of $K$ (e.g., 10, 20, 30, 40, 50) were empirically tested before selecting the best values. Table 30 summarizes the key points of the sensitivity of the proposed approach to its hyperparameters.

## VI. CONCLUSION

This work tackles the problem of movie recommendation which is a powerful tool for proposing personalized movies to a user in a multi-user system containing several movies. Existing techniques used for this purpose (CFRSs, CBFRSs and HFRSs) are individually limited by several factors listed in the last column of Table 1 and none of these techniques takes into account the sequential preferences of the users, as well as the sequential user profiles.

This work attempts to attenuate the limitations of the existing techniques for movie recommendation through the proposal of a new HFRS that uses HMMs for chronologically learning the features of the sequence of movies watched by each user, and the features of the sequence of users who watched each movie. Meta-data derived from these HMMs are then used for representing each user and each movie as a numeric feature vector whose components are interpretable. The resulting features vectors are finally combined for recommending movies to users. Several movie recommendation experiments realized on the open datasets Movielens-100K, Movielens-1M and Movielens-20M exhibited significantly better performances than those of the existing studies regarding the following metrics: precision, recall, F1 score, RMSE, MAE and NDCG.

Future studies may explore the following perspectives:

1) In the current work, stationary distributions are used for deriving feature vectors. As a consequence, the system inherently emphasizes long-term averaged patterns, rather than specific short-term dynamics. This is because the stationary distribution reflects the overall balance of a user's rating tendencies and focuses on how often each rating cluster would occur over time. As a result, the system is well-suited to modeling stable and persistent patterns, but may struggle to adapt quickly to rapid changes. Future work may attempt to enrich the feature vectors generated by the proposed approach to enhance its ability to capture rapidly evolving sequences
2) The proposed approach can be extended by learning other user interactions (e.g., clicks, watch time, etc.) in addition to the user ratings that are already learned, in order to make finer recommendations.

3) In a context where the system users are organized into classes according to specific criteria, the final feature vectors associated with the system users generated by proposed approach can be taken as input by dedicated classifiers for performing user classification. Movie classification can be analogically realized if the movies of the system are organized into classes.

4) The final user feature vectors generated by proposed approach can also enable to organize the system users into clusters in future work using a dedicated clustering algorithm. The movies of the system can also be analogically organized into clusters.

5) The time cost of the proposed approach can be reduced through the design of a parallel version of the proposed system. Future work can analyze the impact of this solution on the overall time cost of the system.

REFERENCES

[1] H. Ko, S. Lee, Y. Park, and A. Choi, "A survey of recommendation systems: Recommendation models, techniques, and application fields," *Electronics*, vol. 11, no. 1, p. 141, Jan. 2022.

[2] J. L. Herlocker, J. A. Konstan, L. G. Terveen, and J. T. Riedl, "Evaluating collaborative filtering recommender systems," *ACM Trans. Inf. Syst.*, vol. 22, no. 1, pp. 5–53, 2004.

[3] (2024). *Amazon Statistics: Key Figures & Trends*. Accessed: Dec. 10, 2024. [Online]. Available: https://www.sales-hacking.com/post/statistiques-amazo

[4] (2024). *54 Facts and Statistics You Need to Know About Amazon*. Accessed: Dec. 10, 2024. [Online]. Available: https://lemakers.fr/statistique-amazon/

[5] (2023). *Netflix—Facts and Figures*. Accessed: Dec. 12, 2024. [Online]. Available: https://fr.statista.com/themes/3090/netflix/#topicOverview

[6] (2024). *450+ Video Marketing Statistics You Need to Know to Boost Your Strategy*. Accessed: Dec. 12, 2024. [Online]. Available: https://www.popcornvideo.fr/70-statistiques-marketing-video/

[7] (2024). *Utilisation croissante des réseaux sociaux au Cameroun: Plus de 5 millions d'utilisateurs actifs en 2024*. Accessed: Dec. 12, 2024. [Online]. Available: https://237actu.com/utilisation-croissante-des-reseaux-sociaux-au-cameroun-plus-de-5-millions-d-utilisateurs-actifs-en-2024/

[8] H. Steck, "Embarrassingly shallow autoencoders for sparse data," in *Proc. World Wide Web Conf.*, May 2019, pp. 3251–3257.

[9] R. Zhang and Y. Mao, "Movie recommendation via Markovian factorization of matrix processes," *IEEE Access*, vol. 7, pp. 13189–13199, 2019.

[10] M. F. Aljunid and M. Dh, "An efficient deep learning approach for collaborative filtering recommender system," *Proc. Comput. Sci.*, vol. 171, pp. 829–836, Jan. 2020.

[11] M. F. Aljunid and M. Doddaghatta Huchaiah, "Multi-model deep learning approach for collaborative filtering recommendation system," *CAAI Trans. Intell. Technol.*, vol. 5, no. 4, pp. 268–275, Dec. 2020.

[12] R. Barathy and P. Chitra, "Applying matrix factorization in collaborative filtering recommender systems," in *Proc. 6th Int. Conf. Adv. Comput. Commun. Syst. (ICACCS)*, Mar. 2020, pp. 635–639.

[13] J. M. Musa and X. Zhihong, "Item based collaborative filtering approach in movie recommendation system using different similarity measures," in *Proc. 6th Int. Conf. Comput. Technol. Appl.*, Apr. 2020, pp. 31–34.

[14] T. Anwar and V. Uma, "Comparative study of recommender system approaches and movie recommendation using collaborative filtering," *Int. J. Syst. Assurance Eng. Manage.*, vol. 12, no. 3, pp. 426–436, Jun. 2021.

[15] G. Behera and N. Nain, "Collaborative filtering with temporal features for movie recommendation system," *Proc. Comput. Sci.*, vol. 218, pp. 1366–1373, Jun. 2023.

[16] Y. Koren, "Collaborative filtering with temporal dynamics," *Commun. ACM*, vol. 53, no. 4, pp. 89–97, Apr. 2010.

[17] B. Hidasi, A. Karatzoglou, L. Baltrunas, and D. Tikk, "Session-based recommendations with recurrent neural networks," in *Proc. ICLR Workshop*, 2016, pp. 1–8.

[18] Y. K. Tan, X. Xu, and Y. Liu, "Improved recurrent neural networks for session-based recommendations," in *Proc. 1st Workshop Deep Learn. Recommender Syst.*, Sep. 2016, pp. 17–22.

[19] W.-C. Kang and J. McAuley, "Self-attentive sequential recommendation," in *Proc. IEEE Int. Conf. Data Mining (ICDM)*, Nov. 2018, pp. 197–206.

[20] M. Quadrana, P. Cremonesi, and D. Jannach, "Sequence-aware recommender systems," *ACM Comput. Surveys*, vol. 51, no. 4, pp. 1–36, Jul. 2019.

[21] J. Tang and K. Wang, "Personalized top-N sequential recommendation via convolutional sequence embedding," in *Proc. 11th ACM Int. Conf. Web Search Data Mining*, Feb. 2018, pp. 565–573.

[22] S. Wu, Y.-Y. Tang, Y. Zhu, L. Wang, X. Xie, T. Tan, S. Wu, Y.-Y. Tang, Y. Zhu, L. Wang, and T. Tan, "Session-based recommendation with graph neural networks," in *Proc. AAAI Conf. Artif. Intell.*, vol. 33, 2019, pp. 346–353.

[23] M. Ludewig, D. Jannach, L. Lerche, and M. Jugovac, "Empirical analysis of session-based recommendation methods," *User Model. User-Adapted Interact.*, vol. 31, no. 4, pp. 931–965, 2021.

[24] A. Petrov and C. Macdonald, "RSS: Effective and efficient training for sequential recommendation using recency sampling," *ACM Trans. Recommender Syst.*, vol. 3, no. 1, pp. 1–32, Mar. 2025.

[25] H.-W. Chen, Y.-L. Wu, M.-K. Hor, and C.-Y. Tang, "Fully content-based movie recommender system with feature extraction using neural network," in *Proc. Int. Conf. Mach. Learn. Cybern. (ICMLC)*, vol. 2, Jul. 2017, pp. 504–509.

[26] J. Son and S. B. Kim, "Content-based filtering for recommendation systems using multiattribute networks," *Expert Syst. Appl.*, vol. 89, pp. 404–412, Dec. 2017.

[27] X. Chen, P. Zhao, J. Xu, Z. Li, L. Zhao, Y. Liu, V. S. Sheng, and Z. Cui, "Exploiting visual contents in posters and still frames for movie recommendation," *IEEE Access*, vol. 6, pp. 68874–68881, 2018.

[28] F. Sun, J. Liu, J. Wu, C. Pei, X. Lin, W. Ou, and P. Jiang, "BERT4Rec: Sequential recommendation with bidirectional encoder representations from transformer," in *Proc. 28th ACM Int. Conf. Inf. Knowl. Manage.*, Nov. 2019, pp. 1441–1450.

[29] F. Yuan, A. Karatzoglou, I. Arapakis, J. M. Jose, and X. He, "A simple convolutional generative network for next item recommendation," in *Proc. 12th ACM Int. Conf. Web Search Data Mining*, Jan. 2020, pp. 1716–1726.

[30] G. Lekakos and P. Caravelas, "A hybrid approach for movie recommendation," *Multimedia Tools Appl.*, vol. 36, nos. 1–2, pp. 55–70, Jan. 2008.

[31] G. Badaro, H. Hajj, W. El-Hajj, and L. Nachman, "A hybrid approach with collaborative filtering for recommender systems," in *Proc. 9th Int. Wireless Commun. Mobile Comput. Conf. (IWCMC)*, Jul. 2013, pp. 349–354.

[32] Y. Deldjoo, M. G. Constantin, H. Eghbal-Zadeh, B. Ionescu, M. Schedl, and P. Cremonesi, "Audio-visual encoding of multimedia content for enhancing movie recommendations," in *Proc. 12th ACM Conf. Recommender Syst.*, Sep. 2018, pp. 455–459.

[33] P. Valdiviezo-Díaz and J. Bobadilla, "A hybrid approach of recommendation via extended matrix based on collaborative filtering with demographics information," in *Proc. 4th Int. Conf. Technol. Trends*, Aug. 2018, pp. 384–398.

[34] H.-J. Xue, X. Dai, J. Zhang, S. Huang, and J. Chen, "Deep matrix factorization models for recommender systems," in *Proc. 26th Int. Joint Conf. Artif. Intell.*, Aug. 2017, pp. 3203–3209.

[35] C. Li, M. Zhang, W. Ma, and S. Ma, "A survey on session-based recommender systems," *ACM Comput. Surv.*, vol. 53, no. 2, pp. 1–36, 2021.

[36] N. Sharma and M. Dutta, "Movie recommendation systems: A brief overview," in *Proc. 8th Int. Conf. Comput. Commun. Manage.*, Jul. 2020, pp. 59–62.

[37] Z. Fayyaz, M. Ebrahimian, D. Nawara, A. Ibrahim, and R. Kashef, "Recommendation systems: Algorithms, challenges, metrics, and business opportunities," *Appl. Sci.*, vol. 10, no. 21, p. 7748, Nov. 2020.

[38] S. Kulkarni and S. F. Rodd, "Context aware recommendation systems: A review of the state of the art techniques," *Comput. Sci. Rev.*, vol. 37, Aug. 2020, Art. no. 100255.

[39] L. Wu, X. He, X. Wang, K. Zhang, and M. Wang, "A survey on accuracy-oriented neural recommendation: From collaborative filtering to information-rich recommendation," *IEEE Trans. Knowl. Data Eng.*, vol. 35, no. 5, pp. 4425–4445, May 2023.
[40] G. R. Lima, C. E. Mello, A. Lyra, and G. Zimbrao, "Applying landmarks to enhance memory-based collaborative filtering," *Inf. Sci.*, vol. 513, pp. 412–428, Mar. 2020.

[41] N. Belacel, G. Durand, S. Léger, and C. Bouchard, "Scalable collaborative filtering based on splitting-merging clustering algorithm," in *Proc. 10th Int. Conf. Agents Artif. Intell.*, Jan. 2018, pp. 290–311.

[42] X. Su and T. M. Khoshgoftaar, "A survey of collaborative filtering techniques," *Adv. Artif. Intell.*, vol. 2009, pp. 1–19, Oct. 2009.

[43] M. J. Pazzani and D. Billsus, "Content-based recommendation systems," in *The Adaptive Web: Methods and Strategies of Web Personalization*. Cham, Switzerland: Springer, 2007, pp. 325–341.

[44] F. Mansur, V. Patel, and M. Patel, "A review on recommender systems," in *Proc. Int. Conf. Innov. Inf., Embedded Commun. Syst. (ICIIECS)*, Mar. 2017, pp. 1–6.

[45] S. Airen and J. Agrawal, "Movie recommender system using parameter tuning of user and movie neighbourhood via co-clustering," *Proc. Comput. Sci.*, vol. 218, pp. 1176–1183, Feb. 2023.

[46] A. Sang and S. K. Vishwakarma, "Design and implementation of collaborative filtering approach for movie recommendation system," *Int. J. Comput. Appl.*, vol. 167, no. 12, pp. 18–24, Jun. 2017.

[47] C.-S.-M. Wu, D. Garg, and U. Bhandary, "Movie recommendation system using collaborative filtering," in *Proc. IEEE 9th Int. Conf. Softw. Eng. Service Sci. (ICSESS)*, Nov. 2018, pp. 11–15.

[48] S. Reddy, S. Nalluri, S. Kunisetti, S. Ashok, and B. Venkatesh, "Content-based movie recommendation system using genre correlation," in *Smart Intelligent Computing and Applications*. Cham, Switzerland: Springer, 2019, pp. 391–397.

[49] R. H. Singh, S. Maurya, T. Tripathi, T. Narula, and G. Srivastav, "Movie recommendation system using cosine similarity and KNN," *Int. J. Eng. Adv. Technol.*, vol. 9, no. 5, pp. 556–559, Jun. 2020.

[50] N. Pradeep, K. R. Mangalore, B. Rajpal, N. Prasad, and R. Shastri, "Content based movie recommendation system," *Int. J. Res. Ind. Eng.*, vol. 9, no. 4, pp. 337–348, 2020.

[51] S. Agrawal and P. Jain, "An improved approach for movie recommendation system," in *Proc. Int. Conf. I-SMAC (IoT Social, Mobile, Analytics Cloud) (I-SMAC)*, Feb. 2017, pp. 336–342.

[52] G. T. Z. Iştık, "A hybrid movie recommendation system using graph-based approach," *Int. J. Comput.*, vol. 7, no. 2, pp. 29–37, 2018.

[53] K. N. Jain, V. Kumar, P. Kumar, and T. Choudhury, "Movie recommendation system: Hybrid information filtering system," in *Intelligent Computing and Information and Communication*. Cham, Switzerland: Springer, 2018, pp. 677–686.

[54] V. W. Anelli, A. Bellogín, T. Di Noia, D. Jannach, and C. Pomo, "Top-N recommendation algorithms: A quest for the state-of-the-art," in *Proc. 30th ACM Conf. User Model., Adaptation Personalization*, Jul. 2022, pp. 121–131.

[55] M. Goyani and N. Chaurasiya, "A review of movie recommendation system: Limitations, survey and challenges," *ELCVAI Electron. Lett. Comput. Vis. Image Anal.*, vol. 19, no. 3, pp. 18–37, Sep. 2020.

[56] F. Ricci, L. Rokach, and B. Shapira, "Recommender systems: Techniques, applications, and challenges," in *Recommender Systems Handbook*, F. Ricci, L. Rokach, and B. Shapira, Eds., Cham, Switzerland: Springer, 2022, pp. 1–35, doi: 10.1007/978-1-0716-2197-4_1.

[57] Q. Dong, S.-S. Xie, and W.-J. Li, "User-item matching for recommendation fairness," *IEEE Access*, vol. 9, pp. 130389–130398, 2021.

[58] L. R. Rabiner, "A tutorial on hidden Markov models and selected applications in speech recognition," *Proc. IEEE*, vol. 77, no. 2, pp. 257–286, 1989.

[59] J. Kang. (2021). *Stat 243: Stochastic Process*. [Online]. Available: https://bookdown.org/jkang37/stochastic-process-lecture-notes/lecture09.html

[60] T. Schnabel, M. Wan, and L. Yang, "Situating recommender systems in practice: Towards inductive learning and incremental updates," 2022, arXiv:2211.06365.

[61] P. Zhang and S. Kim, "A survey on incremental update for neural recommender systems," 2023, arXiv:2303.02851.

[62] J. Oh and S. Cho, "Measuring recency bias in sequential recommendation systems," 2024, arXiv:2409.09722.

[63] S.-H. Cha, "Comprehensive survey on distance/similarity measures between probability density functions," *City*, vol. 1, no. 2, pp. 1–8, 2007.

[64] Z. Zhang, "Introduction to machine learning: K-nearest neighbors," *Ann. Transl. Med.*, vol. 4, no. 11, p. 218, Jun. 2016.

[65] P. Hennequin, "Combinatorial analysis of quicksort algorithm," *RAIRO-Theor. Informat. Appl.*, vol. 23, no. 3, pp. 317–333, 1989.

[66] M. M. Abdoulahi and S. Iloga, "Flexible graph comparison using HMMs," *IEEE Access*, vol. 12, pp. 92988–93009, 2024.

[67] D. Valcarce, A. Bellogín, J. Parapar, and P. Castells, "Assessing ranking metrics in top-N recommendation," *Inf. Retr. J.*, vol. 23, no. 4, pp. 411–448, Aug. 2020.

<figure><img src="image_20.png" /></figure>

**J. CHIASSEUP KEUDJEU** received the master's and Ph.D. degrees in computer science from the Faculty of Science, University of Yaoundé I, Cameroon, in 2010, her master's focusing on e-learning under the supervision of Pr Claude Tangha, and her Ph.D. under the supervision of Sylvain Iloga and of T. Bouetou Bouetou. She has been a part-time Teacher of computer science with the National Advanced School of Engineering, Yaounde, since 2011. Her current research interest

includes data modeling using hidden Markov models.

<figure><img src="image_21.png" /></figure>

**O. KENGNI NGANGMO** received the Ph.D. degree in computer science from the University of Maroua, Cameroun, in January 2022. From May 2009 to October 2022, she was a Teacher and a Researcher with the University of Maroua, firstly with the Higher Teachers' Training College and then with the Faculty of Sciences. Since November 2022, she has been a Teacher and a Researcher with the Department of Information and Communication Technologies, Faculty of

Sciences, University of Ebolowa, Cameroun. She has been a Senior Lecturer, since 2022. Her researches mainly focus on security in cloud of things and in the IoT, data modeling using hidden Markov models, and machine learning.

<figure><img src="image_22.png" /></figure>

**SYLVAIN ILOGA** received the Ph.D. degree in computer science from the University of Yaoundé I, Cameroon, in January 2018. Since January 2010, he has been a Teacher with the Department of Computer Science, Higher Teachers' Training College, Maroua, Cameroon. From September 2017 to August 2019, he completed a research and teaching internship with the IUT of Cergy-Pontoise, Neuville University, France. In January 2019, he was qualified as an Associate Professor

with Section 27 (Computer Science), France. From October 2022 to July 2024, he was a Teacher with the ESIEE-IT CCI Paris Île-de-France, France. In November 2023, he was subsequently promoted to the rank of an Associate Professor in Cameroon. Beside this, he is an Associate Member with the Research Laboratory ETIS UMR 8051, ENSEA, CNRS, CY Cergy Paris Université, Cergy, France. His researches mainly focus on data modeling through machine learning using hidden Markov models, with the final goal to design their implementation into reconfigurable architectures.

<figure><img src="image_23.png" /></figure>

**T. BOUETOU BOUETOU** is currently a Full Professor, a Leading Researcher, and the Head of Department of Computer Science with the University of Yaoundé I, Cameroon. His area of research focuses on applied mathematics and computing. He has supervised several Ph.D. students in various fields of applied mathematics he is opened to research collaboration and international research to support the development of Africa.

<figure><img src="image_24.png" /></figure>