**Data Analysis and Mining**

Editors

**Stefanos Ougiaroglou Dionisis Margaris**

*Editors* Stefanos Ougiaroglou Department of Information and Electronic Engineering International Hellenic University Sindos, Thessaloniki Greece

Dionisis Margaris Department of Digital Systems University of the Peloponnese Kladas, Sparta Greece

*Editorial Office* MDPI St. Alban-Anlage 66 4052 Basel, Switzerland

This is a reprint of articles from the Special Issue published online in the open access journal *Applied Sciences* (ISSN 2076-3417) (available at: www.mdpi.com/journal/applsci/special issues/ data analysis mining).

For citation purposes, cite each article independently as indicated on the article page online and as indicated below:

Lastname, A.A.; Lastname, B.B. Article Title. *Journal Name* **Year**, *Volume Number*, Page Range.

**ISBN 978-3-0365-9503-0 (Hbk) ISBN 978-3-0365-9502-3 (PDF) doi.org/10.3390/books978-3-0365-9502-3**

© 2023 by the authors. Articles in this book are Open Access and distributed under the Creative Commons Attribution (CC BY) license. The book as a whole is distributed by MDPI under the terms and conditions of the Creative Commons Attribution-NonCommercial-NoDerivs (CC BY-NC-ND) license.

## **Contents**

## **About the Editors**

#### **Stefanos Ougiaroglou**

Stefanos Ougiaroglou is an assistant professor in the Department of Information and Electronic Engineering at the International Hellenic University, where he teaches courses on programming, databases, web application development, and data mining. He received a B.Sc. in Computer Science (2004) from the Department of Informatics at the Alexander TEI in Thessaloniki, Greece; an M.Sc. in Computer Science (2006) from the Department of Computer Science at Aristotle University in Thessaloniki, Greece; and a PhD in Computer Science (2014) from the Department of Applied Informatics at the University of Macedonia, Greece. His research interests include data mining algorithms, data reduction, data streams, data management for mobile computing, databases, algorithms and data structures, educational technology, and web application development. He has published several papers in peer-reviewed international journals and conferences proceedings.

#### **Dionisis Margaris**

Dionisis Margaris is an assistant professor in the Department of Digital Systems, University of the Peloponnese, Greece, where he teaches courses on programming, operating systems, software technology, and information systems. He received his B.Sc., M.Sc., and Ph.D. from the Department of Informatics and Telecommunications, University of Athens, Greece, in 2007, 2010, and 2014, respectively. He has published more than 70 papers in peer-reviewed international journals, books, and conferences proceedings. His research interests include information systems, personalization, recommender systems, business processes, and web services and data mining.

## **Preface**

To date, data analysis and mining is being used in numerous everyday tasks to solve practical problems. This research field has attracted the interest of both academia and industry. The research community has developed algorithms, techniques, and tools for the prediction of future situations, discovery of clusters with similar data, association rules in mining, and pattern recognition, among others, all of which have found applications in many domains, such as medicine, finance, business, biology, marketing, and education. In this reprint, 17 papers are published on different topics of the broad research field of data analysis and mining. Each of the included papers presents new data mining algorithms and techniques, as well as applications of data analysis and mining in real-world domains. These papers have been carefully selected based on a vigorous peer-review process involving several respectful reviewers organized by *Applied Sciences*. It is our sincere hope that these papers will provide new inspiration for the development and application of data analysis and mining. We would like to thank all the authors and reviewers who contributed to this reprint.

> **Stefanos Ougiaroglou and Dionisis Margaris** *Editors*

### *Article* **A Data-Science Approach for Creation of a Comprehensive Model to Assess the Impact of Mobile Technologies on Humans**

**Magdalena Garvanova 1,\*, Ivan Garvanov 1, Vladimir Jotsov 1,2, Abdul Razaque 2,\*, Bandar Alotaibi 3, Munif Alotaibi 4 and Daniela Borissova 1,5**

**Abstract:** Mobile technologies are an essential part of people's everyday lives since they are utilized for a variety of purposes, such as communication, entertainment, commerce, and education. However, when these gadgets are misused, the human body is exposed to continuous radiation from the electromagnetic field created by them. The communication services available are improving as mobile technologies advance; however, the problem is becoming more severe as the frequency range of mobile devices expands. To solve this complex case, it is necessary to propose a comprehensive approach that combines and processes data obtained from different types of research and sources of information, such as thermal imaging, electroencephalograms, computer models, and surveys. In the present article, a complex model for the processing and analysis of heterogeneous data is proposed based on mathematical and statistical methods in order to study the problem of electromagnetic radiation from mobile devices in-depth. Data science selection/preprocessing is one of the most important aspects of data and knowledge processing aiming at successful and effective analysis and data fusion from many sources. Special types of logic-based binding and pointing constraints are considered for data/knowledge selection applications. The proposed logic-based statistical modeling method provides both algorithmic as well as data-driven realizations that can be evolutionary. As a result, non-anticipated and collateral data/features can be processed if their role in the selected/constrained area is significant. In this research, the data-driven part does not use artificial neural networks; however, this combination was successfully applied in the past. It is an independent subsystem maintaining control of both the statistical and machine-learning parts. The proposed modeling applies to a wide range of reasoning/smart systems.

**Keywords:** signal processing; smart device; electromagnetic field; non-ionizing radiation protection; SAR; ANOVA; data science; selection; constraint satisfaction; preprocessing; mobile technology; machine learning; statistics

#### **1. Introduction**

The methods used in data science show ways to find solutions to a specific problem [1]. With the development of technology, the types of data to be analyzed are diverse and heterogeneous [2]. Having many and varied sensors to register an event or phenomenon is a great advantage in data processing and decision making but also a great challenge for data analysts [3]. The processing, aggregation, and analysis of disparate data is a complex process that can be facilitated by the use of intelligent solutions [4].

The study of the issue of the effects of smart devices on humans is an extremely recent scientific task that requires the processing and analysis of diverse data sets obtained from

**Citation:** Garvanova, M.; Garvanov, I.; Jotsov, V.; Razaque, A.; Alotaibi, B.; Alotaibi, M.; Borissova, D. A Data-Science Approach for Creation of a Comprehensive Model to Assess the Impact of Mobile Technologies on Humans. *Appl. Sci.* **2023**, *13*, 3600. https://doi.org/10.3390/ app13063600

Academic Editors: Stefanos Ougiaroglou and Dionisis Margaris

Received: 4 January 2023 Revised: 28 February 2023 Accepted: 2 March 2023 Published: 11 March 2023

**Copyright:** © 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

1

numerous measurements [5]. It is not possible to give an unambiguous answer to this question when conducting the same type of research. Smart technologies are all around us and, in the near future, their number will increase many times over [6]. One of the most popular and currently used smart devices is the smartphone, which is used for both work and entertainment [7].

In recent years, this type of device has been increasingly used, and children and early teens own and use smartphones. These devices are used for communication, work, games, entertainment (watching movies and listening to music), visiting social networks, and more. At the same time, there are studies and analyses of the impact of these technologies on humans, and these effects are both psychological and biophysical in nature [8]. The smartphone is close to its owner, and the amount of time spent with this device is constantly increasing [9]. This process is difficult to interrupt or limit; however, if the consequences of overuse are studied and properly analyzed, the question of how to reduce the harmful effects on humans can be answered [10].

The psychological effects of smart technologies are the result of their long-term use and merging of the real and virtual worlds, which leads to social alienation, psychological loneliness, personal anxiety, low self-esteem, and hence to depressive states. More specific questions are related to: what is internet addiction and what physical and mental symptoms characterize this condition, the types of addictions, the extent to which they spread in society and what are the main areas affected, which is the most at-risk group among the population, what are the consequences, and—last but not least—the mechanisms of therapy and prevention.

Among the most commonly used methods of analysis are statistics from consulting agencies, content analysis of sites and blogs, and data from empirical studies and psycho diagnostic tests. The data analytics processes can be successfully combined with logicbased modeling instruments with the aim to create more medical applicable, versatile, and universal decisions.

Some experts find that dependence on smart technologies, and in particular on the services they offer, is not a separate behavioral disorder but a syndrome of a serious socio-psychological problem. The majority of researchers believe that the combination of addiction to cyberspace, together with electromagnetic radiation from smart devices, is a risk factor with dangerous consequences for the mental and physical health of an individual.

This article discusses the data-science approach to creating a comprehensive model for assessing the impact of mobile technologies on humans. The aim is to propose a datascience concept for the preprocessing, processing, and postprocessing of disparate data obtained from various sensors, measuring devices, and computer models for assessing the impact of mobile technologies on humans.

#### *1.1. Paper Organization*

The remainder of this paper is organized as follows. Section 2 presents the salient features of existing works. Section 3 presents the main statistical data processing methods. Section 4 shows the results from measuring the electromagnetic field, which reveal that, under certain conditions, mobile devices emit high-frequency electromagnetic waves and can cause various negative effects on humans. Section 5 discusses the most popular dosimetric values that estimate the levels of absorption of electromagnetic fields by the human body.

Modeling for SAR is used to mimic and illustrate the process of electromagnetic field absorption by the human head in Section 6. The collection and processing of thermal images are shown in Section 7. In Section 8, the experimental results and discussion are presented related to the change of brain activity of a mobile phone user. Section 9 proposes the use of complex data preprocessing, postprocessing, deep modeling, and analysis models by using intelligent methods. Finally, in Section 10, the paper is concluded.

#### *1.2. Research Methodology*

Extensive investigation, familiarity, and evaluation are crucial components in laying the groundwork for our suggested strategy. In order to handle and analyze heterogeneous data, we developed a sophisticated model based on mathematical and statistical techniques, and we then compared it to current state-of-the-art algorithms. In order to obtain these results, libraries were employed with existing algorithms. We reviewed the literature for a variety of study subjects and datasets and published the findings. These findings show that some of the outcomes are comparable to our suggested methodology.

The purpose of our study is to understand how mobile phones affect people in order to forward our efforts, which are described in this paper. In conclusion, because of the nature of the problem and the datasets that the algorithms are intended for, a true comparison is fairly challenging. In other terms, one may do better than the other in some situations, while the opposite results may occur in others. This article's focus does not enable for a thorough analysis and experimental investigation of each. A thorough evaluation of different methods is provided. Furthermore, it can be said that a more complex approach is required to solve the research issue, one that involves performing various experimental measurements, compiling statistical data, and using a computer model to explain some physiological effects brought on by electromagnetic wave exposure to the human head.

#### **2. Related Work**

This section discusses the main contributions of the current works. An assessment of the environmental and human health implications of base station and mobile phone radiation is provided [11]. A key invention that has changed people's lifestyles is the cell phone. With the widespread use of mobile phones in everyday life, the standard of living has significantly improved around the world. There have always been concerns about the effects of radio frequency radiation on humans, plants, and animals. Furthermore, it is alleged that the radiation emitted by mobile phones damages human health and jeopardizes the enjoyment and convenience derived from using the devices. The authors in [12] analyzed the changes that these smart phone technologies can bring to human– nature interactions while focusing on the outdoor behaviors of experienced outdoor users.

GHz [13] presented that the exposure of the human body to electromagnetic fields (EMF) with different frequencies can cause different biophysical effects. Thermal effects are typically minimal with frequencies less than 100 kHz; however, effects appear when increasing the frequencies. Smartphones communicate via high-frequency signals, and extended use of the generated electromagnetic field affects the skull. Additionally, irritability, memory impairment, weariness, anxiety, headaches, and disrupted sleep are primary indicators of changes in the body. It is believed that the changes caused by EMF are able to accumulate in the body under conditions of prolonged exposure.

As a result, pathologies, such as leukemia, brain tumors, and hormonal diseases, can develop. Research has investigated memory loss, Parkinson's and Alzheimer's disease, amyotrophic sclerosis, AIDS, and an increase in suicides in relation to EMF exposure [14]. Another consequence of exposure to EMF in people is the syndrome of premature aging of the body. Despite extensive investigations, there remain a variety of unknown and undiagnosed addictions in people induced by EMF. All of these impacts have been recorded using various research approaches.

These include the processing of thermal pictures to analyze thermal effects and the processing of EEG signals to assess brain activity [15]. To obtain a unified thorough evaluation of the impact of smart technology on humans, an intelligent approach for assessing various data is presented. To that end, this study proposes a framework for combining disparate data sets in order to assess the impact of smart technology on humans. Additionally, new methods for acquiring and evaluating empirical and experimental data are required to overcome the problem. A proposed paradigm for unification and intelligent solutions is effectively evaluated in this research for addressing difficulties.

#### **3. Statistical Data Processing**

It is feasible to collect data on the impacts of mobile devices on the psychological and physical health of the users to measure the impacts of active usage of smart technology. Correlation analysis was used to establish the relationships and the degree of dependence between individual variables. The most commonly used correlation coefficient is the Pearson coefficient (*r*) for linear correlation, which is calculated by the formula [16]:

$$r = \frac{P}{S\_X S\_Y} \tag{1}$$

where *P*—moment of the products; *SX*—standard deviation of the variable *X*; and *SY*—standard deviation of the variable *Y*. The moment of the products (*P*) is calculated as:

$$P = \frac{\sum XY}{n - 1} - \frac{\sum X \sum Y}{n(n - 1)} \tag{2}$$

where ∑ *X*—sum of *X* values; ∑ *Y*—sum of *Y* values; ∑ *XY*—sum of products of *X* and *Y*; and *n*—sample size.

Another statistical criterion that is successfully used to determine changes in the responses and/or conditions of subjects as a result of an experimental intervention is Student's *t*-test for related samples, which involves research design "before-and-after". It has the ability to work with small volumes of data, and there is measurement "before the intervention", measurement "after the intervention", and the recording of statistically significant differences in the values of the tested variables. The empirical value of the t-test is calculated by the formula [16]:

$$t\_E = \frac{|d|}{\sqrt{\frac{\sum d^2 - nd^2}{n^2 - n}}} \tag{3}$$

where *d* = *X*2 − *X*1 is the difference between two measured values of each object, *n* is the number of observed objects, and *d f* are the degrees of freedom *d f* = *n* − 1.

Among the most powerful statistical techniques for studying causal relationships is ANOVA (Analysis of Variance). One-way ANOVA provides analysis of the variation of a quantitatively dependent variable—for example, the degree of internet addiction caused by an independent qualitative or quantitative variable—for example, the age group. According to the null hypothesis, ANOVA is used to test the assumption of whether several means are equal, allowing determination of not only the differences between them but also which exact mean values differ from the others.

Table 1 shows the formulas for calculating the one-way ANOVA. The notations are as follows: *SSb*—sum of between-group squares; *SSw*—sum of within-group squares; *SST*—total sum of squares; *K*—degrees of freedom; *nj*—size (number of measurements) for each of the *k* samples (groups); *x*¯*j*—sample mean for the *j*-th group; *x*¯—total mean; *x*¯*ij*—mean of the *i*-th individual from the *j*-th group; and *n*—total sample size. From the presented Table 1, it is clear that the *F*-ratio is obtained by dividing the between-group mean square *MSb* by the within-group mean square *MSw*:

$$F = \frac{MS\_b}{MS\_w} \tag{4}$$

Therefore, the logic of ANOVA is based on the decomposition of the total variance of the variable into two key components: the between-group variance (deviations of the group means from the total arithmetic mean) and within-group variance (individual deviations of the values from the mean within a category (group)).

**Table 1.** One-way ANOVA [16].

The Fisher's *F*-test is checked according to the significance level *α* (usually equal to or less than 0.05) and the degrees of freedom *K*, as follows: for the between-group variance *K*1 = *k* − 1, where *k* is the number of groups compared (degrees of freedom of the numerator); and for the within-group variance *K*2 = *n* − *k*, where *n* is the sample size (degrees of freedom of the denominator).

#### **4. Measuring the Electromagnetic Field from a Smartphone**

These measurements show the presence of electromagnetic fields generated by different models of GSM devices in different operating modes. Depending on where the measurements are made—outdoors or indoors, the results differ. The obtained values additionally vary depending on how far the smartphone is from the measuring equipment or from the distance to the base station, as well as what additional radio sources are nearby. For this purpose, experimental measurements were performed in which the GSM device was positioned at distances of 1 and 10 cm from the smartphone. The average measurement results are shown in Table 2. Measurements were obtained with Gigahertz HFE35C.

**Table 2.** EMF values generated by a GSM device.

The data in Table 2 show that, in search and talk mode, the emission levels are many times higher than in passive mode. When ringing, the signal level is high for the first 20 s, and then decreases significantly. Depending on the location of the smartphone, the signal levels are different, and when indoors, the signal level may be above the normal values. The measurements were performed both indoors and in underground rooms, where the signal source from the base station was extremely weak, and, in order to achieve successful communication, the radiation level of the GSM device was at the maximum value to compensate for attenuation and to not let the conversation fail.

Studies have shown that the level of the electromagnetic field in urban conditions is many times higher than in rural areas. This confirms the assumption that the presence of different types of electrical devices and transmitters will lead to a significant increase in the background electromagnetic field. With the development of technology, this problem will deepen and become more relevant. One of the most serious generators of electromagnetic fields is the smartphone. The level of the electromagnetic field generated by these strongly depends on the mode of operation and the environment in which the phone is located. In some cases, the levels of electromagnetic fields exceed the regulated permissible levels. The proximity of these devices to the human head requires in-depth study of the influence of electromagnetic fields on the possible effects on the human body.

#### **5. Specific Absorption Rate**

The specific absorption rate (*SAR*) shows how much radiation is absorbed by human tissues when irradiated by an electromagnetic field. The *SAR* is a measure of the rate at which the radio-frequency energy from a mobile phone is absorbed by the human body [17].

The local *SAR* is calculated as the power loss *dP*1 absorbed in an infinitesimal mass *dm* in the following way:

$$SAR = \frac{dP\_1}{dm} = \frac{\sigma\_e f f E\_{rms}^2}{\rho} = \frac{f\_{rms}^2}{\rho \sigma\_{eff}}\tag{5}$$

where *Erms* is the root mean square value of the electric field, *Jrms* is the current density. *σeff* is the effective conductivity of human brain tissue, and *ρ* is the tissue density. Therefore, the *SAR* unit of measurement is W/kg. Energy from electromagnetic fields is absorbed into the human tissues and warms them. This leads to another definition of *SAR*, namely:

$$SAR = c\_p \frac{\Delta T}{\Delta t} \tag{6}$$

where *cp* is the specific heat capacity of the tissue and Δ*T* is the change in temperature over a period of time Δ*t*.

A distinction should be made between the instantaneous *SAR* and the permissible SARs, where an average value is measured for a given mass of tissue and a specified period of time. It is best to use a computer model to study the *SAR* and the thermal effects. The benefit of the model is that it visualizes the processes in depth.

#### **6. Modeling for SAR Simulation**

With the use of a computer model, it is feasible to thoroughly analyze *SAR* in the human body. This model may be used to research the effects of mobile phones on the human head since it can be used to visualize the processes of tissue absorption and heat deep within the human body. The characteristics of human tissues can be altered to imitate various age groups. The numerous tissues and bones that make up the human head model each have unique electromagnetic energy-absorption properties.

A mobile phone's characteristics can be changed to emulate various GSM device models. Numerous factors, including the antenna radiation pattern, transmitted signal strength, and signal frequency, are modifiable. The computer model's ability to see the depth of the human head, which can be utilized to analyze the absorption and warming processes in depth, is its most important feature.

For the proper functioning of the model, it is essential to know the biological characteristics of human tissues. The human body is composed of many organs and characterized by specific biological parameters that must be taken into account correctly in the model. The electromagnetic characteristics of the dielectric constant, magnetic permeability, and conductivity [18] should be properly defined for each modeled organ. The created computer model uses parameters that characterize the biological tissues of an adult. The shape of the human head was applied by the IEEE library and was loaded into the COMSOL Multiphysics software. The model was imported from a file named sar\_in\_human\_head.mphbin [19,20].

The source of electromagnetic radiation was a model of a smartphone that was manually added. In the considered model, the location of the device was chosen to be on the left

side of the head in order to facilitate the comparison of the obtained results with thermal images from our previous experimental studies. The mobile device was modeled at a distance of 1 cm from the head as shown in Figure 1.

The electromagnetic parameters of the biological tissues of the human head were modeled through an interpolation function that uses the characteristics of the tissue inside the human head. The output for this function is directly taken from a file named sar\_in\_human\_head\_interp.txt. After simulation of the model, it is possible to estimate the *SAR* on any shape and tissue of the human body. When designing mobile devices, it is important to determine the amount of radiation that can be absorbed by the human body. The use of COMSOL Multiphysics and its radio frequency module allows a faster and moreefficient approach in the design of wireless devices that meet certain safety requirements. The local SAR value in the human head, calculated using the 900 MHz frequency equation, is shown in Figure 2.

**Figure 2.** *SAR* visualization.

When talking to a mobile phone, the human head is very close to the phone, and the power of the emitted electromagnetic field is very high. Penetrating into a person's head, the electromagnetic field releases some of its energy, and the tissues in the head absorb this energy. Electromagnetic energy affects the particles in the tissue due to the electrical and magnetic components of the electromagnetic field. Visualization of the effects of penetration of the electromagnetic wave into the human head can be shown by means of incisions of the head at certain levels (Figure 3).

**Figure 3.** *SAR* visualization at different levels in the human head.

The strongest influence of the electromagnetic waves is in the head area, located in the immediate vicinity of the mobile device [17]. The greatest amount of energy is absorbed in this area, and the penetration into the human head is the greatest. The effects of exposure of the human body to radio frequency radiation mainly depend on the exposure time and the strength of electromagnetic fields. The penetration of the electromagnetic field into the depths of the human head depends on the frequency of the carrier signal. The higher this frequency, the faster it attenuates in space and the less it penetrates the human head. The highest values of absorption are observed on the surface of the human head. The developed model calculated only the local values of the *SAR* parameter. The maximum local *SAR* value is always higher than the maximum mean *SAR* value.

The amount of energy absorbed by the human head affects the temperature to which the tissues of the head are heated. The study of the processes of temperature distribution in the human head and on its surface is possible with the help of the created computer model using the COMSOL Multiphysics software. The frequency of the signal of the mobile device was selected to be 900 MHz. The transformation of the absorbed energy into heat was conducted with a biothermal equation. The change in temperature is a function of the physiological properties of biological tissues and blood circulation in the human body [21]. The thermal effects on and in the human head are shown in Figure 4.

Due to the created computer model, it is possible to study the processes of penetration of the electromagnetic field into the human head and the effects caused by this, thus, thoroughly simulating different situations and different characteristics of the head model and mobile phone characteristics. The visualization capabilities of the COMSOL Multiphysics software are impressive and allow a detailed view of the simulation results.

**Figure 4.** Visualization of the thermal effects in the human head for several horizontal layers.

#### **7. Collection and Processing of Thermal Images**

The impacts of the use of GSM devices on the physical condition of a person can be assessed by the thermal effects caused by the electromagnetic waves emitted by GSM devices. The experimental scenario includes a speaker with a GSM device for 20 min and a FLIR P640 thermal camera to capture their head in profile and full face. During the conversation, the GSM device was located about 1 cm from the head of the participant in the experiment, and the thermal camera was about 2 m away, focused on their head. The average room temperature was around 22 ◦C.

As a result of the 20 min conversation and the irradiation with the electromagnetic waves from the GSM device, the head of the participant in the experiment warms up by about 1–2 ◦C as can be seen from Figure 5. The increase in head temperature depends on the duration of the conversations. When talking for up to 30 s, no change in intracranial temperature is observed; however, when talking for more than 2 min, first, the ear begins to warm up and then the soft tissues around the ear. The increase in temperature is a result of prolonged irradiation of the human body with high-frequency radio signals from the GSM device.

The obtained results show that the temperature on the surface of the head is the highest and decreases in depth. The temperature change near the mobile phone is on the order of 0.6 ◦C and decreases rapidly inside the head. The thermal effects obtained from the model largely coincide with the results of a real experiment conducted with a thermal camera (Figure 5).

Averaging the temperature of the head before and after the experiment resulted in a temperature difference of about 1.3 ◦C. After checking the number of pixels exceeding the temperature of 34 ◦C before and after the experiment, we found that, after the experiment, the area heated above this value was three-times larger than before the experiment. The thermal images were processed using MATLAB. The study found that the temperature of the head on the side of the GSM device heated up much more than the other side. The areas around the ear, forehead, and neck heated up much more than the rest of the head.

The study of the processes of penetration of the electromagnetic field into the human head and the effects caused by this is an extremely important scientific task. The interaction between the human head and the electromagnetic radiation caused by cell phones can cause electric currents and electric fields in the human head, which can lead to negative health effects.

#### **8.  EEG signals are obtained as a result of the work of neurons in the human brain and can be intercepted using electrodes attached to the surface of the scalp [22–24].

A series of experiments were conducted to analyze the possible effects of the electromagnetic fields generated by smartphones on the activity of the human brain. Thirty volunteers (16 men (53.3%) and 14 women (46.7%) with an average age of 45.2 years) participated in the studies; however, we plan to increase these numbers in future studies among adults and children. The participants in the study stated that they were physically and mentally healthy, that they had not taken any medication before the tests, and that they were voluntarily undergoing these tests. The experiments were conducted in two stages.

The first stage involved studying the EEG signals of the subjects without using a mobile phone. The second stage of the experiment was performed while the subjects used a mobile phone (Figure 6). The EEG recordings from the two experiments were processed in the MATLAB environment in the time and frequency domain of the signal. The aim was to make a comparative analysis of the signal spectra from the two experiments.

Measures to reduce any other brain activity have been taken to assess the effect of cell phone electromagnetic radiation on a person's brain activity. The experiments were conducted in a quiet and cozy room, with the test subjects placed in comfortable armchairs with their eyes closed to reduce side stimuli. During the experiments, participants held the phone at a distance of about 1 cm away from the head, listening to a quiet countdown from one to one hundred, which was started by a researcher in another room. The aim of the experiment was to be as close as possible to a real conversation as shown in Figure 6.

A mobile phone with a SAR of 0.36 W/kg was used during the experiment. The experiment lasted about an hour with the first 30 min without a phone and the second 30 min with a phone. The obtained signals were filtered and divided into frequency ranges, respectively: delta *δ* (1–4 Hz), theta *θ* (4–8 Hz), alpha *α* (8–13 Hz), and beta *β* (13–32 Hz). With the help of the Pwelch function of the MATLAB program, the spectra of the signals before and after a call with a mobile device were obtained. The spectra of the two experiments for all electrodes were compared, and differences in the spectra were found at several measurement points (Figure 7).

**Figure 6.** Participant during the experiment.

At the points with the numbers T3, T5, and F7, which are the closest to the mobile phone, a significant change in the spectral activity of the brain was found. The largest change in the spectrum was found in T3, where the changes were in the theta, alpha, and beta frequency ranges. The changes in the spectra at points T5 and F7 were only in the theta and alpha ranges. Interestingly, this dependence was found in all participants in the experiments but to varying degrees.

**Figure 7.** (**a**) Differences in the spectra by range and (**b**) different GSM ranges for delta, theta, alpha, and beta.

To compare the average spectral exposure with and without GSM for the ranges of delta *δ* (1–4 Hz), theta *θ* (4–8 Hz), alpha *α* (8–13 Hz), and beta *β* (13–32 Hz), Student's *t*-test for related samples was used (Howard, 2008). Statistically significant differences, where *p* < 0.05, are visualized in Figure 7.

The change in brain activity in a person's head on the side of a mobile phone has a short-term effect that is shown to be due to the operation of a mobile phone. If the *SAR* is studied and analyzed in more detail using a computer model, we expect that the changes in brain activity will be closely related to the location and amount of absorbed electromagnetic energy. This relationship has not been studied in sufficient depth and requires further research into the body's biophysical responses; thus, this is of interest for future research.

#### *Accuracy*

The degree of similarity between a measurement and its real value is referred to as accuracy. A limited number of EEG channels recorded concurrently can improve the accuracy. Two distinct types of tests were conducted to evaluate brain activity and lasted 30 min. The first experiment was performed without a cell phone (GSM); however, the second experiment included a mobile phone while subtracting brain activity. Interesting discoveries were made, and it was revealed that, while utilizing a cell phone, the accuracy was somewhat reduced.

Figure 8 demonstrates the accuracy and compares the average spectrum exposure with and without GSM for the ranges of delta (1–4 Hz), theta (4–8 Hz), alpha (8–13 Hz), and beta β (13–32 Hz). Figure 8a indicates that the accuracy without a mobile phone was 99.95%, whereas the accuracy with a mobile phone was 99.78% utilizing a delta range of (1–4 Hz). Figure 8b shows that, with the theta (4–8 Hz) frequency range, 99.88% accuracy was obtained without a mobile phone, whereas 99.69% accuracy was obtained with a mobile phone.

**Figure 8.** (**a**) The accuracy of the average spectrum exposure with and without GSM using the frequency range of delta δ (1–4 Hz). (**b**) The accuracy of the average spectrum exposure with and without GSM using the frequency range of theta θ (4–8 Hz). (**c**) The accuracy of the average spectrum exposure with and without GSM using the frequency range of alpha α (8–13 Hz). (**d**) The accuracy of the average spectrum exposure with and without GSM using the frequency range of beta β (13–32 Hz).

Figure 8c depicts the 99.81% accuracy with the alpha (8–13 Hz) range in the absence of a mobile phone. A cell phone, on the other hand, achieved 99.58% accuracy in the same frequency band. Figure 8d exhibits 99.80% accuracy without a mobile phone utilizing a beta (13–32 Hz) frequency range and 99.59% accuracy with a mobile phone.

#### **9. Processing of Complex Data Analysis Models Using Intelligent Methods**

Intelligent methods are the processes of gathering, modeling, and analyzing data in order to derive insights that may be used to make decisions.

#### *9.1. Deep Knowledge Modeling and Constraint-Based Fast Preprocessing*

The preprocessing of data is effectively utilized in different domains, such as number theory, cryptography, intelligent measurement, education, and bioinformatics. The chances of making an improvement will be quite slim without a comprehensive description of the surroundings. It is clear from working with description logic that logic-based modeling is challenging to control, that it is challenging to merge the logical and statistical phases of the data science cycle, and that their algorithmic complexity is often considerable.

On the other hand, it is possible to reason using the body of knowledge, and this capability enables the development of knowledge- and data-driven open systems. It is simple to combine the suggested study with the mentioned non-classical logical methodologies. More information is available in [25]. When discussing data-driven methodologies, artificial neural networks (ANNs), such as deep learning, are frequently used. In order to enhance the quality of human-like reasoning, this paper investigated a novel data-driven methodology that makes use of modeling and constraint fulfillment characteristics.

The constraint satisfaction methods are frequently used in data-preprocessing issues. A selection of data was applied aiming to complete preprocessing more efficiently, and the considered deep-modeling constraint satisfaction methods significantly improved this process. Currently, the following groups of novel logically-inspired constraints have been investigated in [25–27]. The mema method for control is named Puzzle but it significantly differs from the methods constructed for solving puzzles, such as [26–29].

The latter are ineffective because of the usage of random number strategies. The proposed Puzzle approach is easily combined with these and other methods [30] with the aim to increase their efficiency. Initially the classical constraint satisfaction methods can be applied with the purpose to form a closed focus area where certain data may be logically connected.

Let us focus on the considered two objects, ones of the many enclosed in the area from Figure 9. The closed 'focus/selection area' helps to reveal new knowledge concerning the enclosed objects. The data analysis concerning this case can reveal new knowledge, for example, that *M* implies *N* or that *M* has some relationship to *N*. The second case is the result of the classical link analysis and/or corresponding data mining applications. Some general disadvantages: the classical approach works with a priori given data and is not intended for the elaboration of open systems.

In practice, the constraints should be dynamically changed depending on the current knowledge/data. This becomes possible after the introduction of new types of non-classical constraints. Generally speaking, there should be new types of constraints introduced. Constraint violation is impossible in the classical case but this case should be reconstructed. Every rule/constraint could be defeated depending on the conditions. The new types of constraints make it possible. Somebody who exposed their body to radiation generally does not think about cancer that could occur 20 years later. Many other application problems arise in medical practice where the problems are gradually accumulating.

**Figure 9.** A set of three linear constraints constructs a closed area focusing on objects *M* and *N*.

With new conditions, additional questions arise: **why** the constraints are imposed, **what** and when violates it, **where** it could be defeated, and other use cases.

Binding, pointing, and crossword are the new groups of constraints. There exist many binding situations, and some of them have been researched in this article. The first case is when the maximum binding possibility is concentrated in the center of the area, and the distance from it is a function diminishing its value. The proposed research revealed that the binding may depend on certain conditions, and it may also influence the features of all objects contained in its area: the linearity/range/the region of the usage and/or other properties could be defeated. The general case is depicted in Figure 10 where curves *B* and *D* are the bindings concerning the searched goal *G*1.

**Figure 10.** A set of nonlinear constraints in combination with the proposed three groups of logicallybased constraints.

Association methods are generalized in binding constraint theories [31–36]. Associations are purposed for finding implicative classical form of rules, while the binding constraints explore any form of causal relationships. We investigated only a few binding constraint groups but they were very useful as a data-science modeling tool.

1. Denote *A* is bound to *B* if there is proven evidence of any form of causal relationship between them. The implication is also included in this case. Should the type of the causal form should be described in special forms of metaknowledge attached to the corresponding binding case? For example, some people

are very sensitive to long phone calls. The personal binding constraint 'phone call > 10 min'− >'tired' or 'noise in the head' should be added to the modeling case. The metaknowledge should include the complex of disease history, a nervous state, a history of complaints, and corresponding factors. Semantic reasoners are very helpful in binding information processing.

In Figure 11, an example is shown where the linearity of a classical constraint satisfaction case is fuzzified/defeated in the considered binding constraint area.

**Figure 11.** Type-6 binding constraint and its influence on classical linear constraints.

Agents, especially in health-oriented systems, can not effectively behave using a set of algorithms. In certain conditions, every solution may be modified or changed. One of the frequent forms of change is defeasible reasoning. In practice, the software agent should defeat its goals aiming at better performance. Every rule should be gradually improved and modified and/or suddenly changed depending on the situation in a data-driven way. The defeasible scheme controls the usage of many unified exclusions and other defeasible knowledge forms.

Let a Horn clause describe Rule (7).

$$B \leftarrow \Lambda\_{i \in I} A\_i \tag{7}$$

where the form of the rule is suitable for the backward chaining. This rule is changed when an exclusion *E*(*C*, *Ak*) is attached to Equation (7): if *C* is true, the corresponding *Ak* is defeated, which means that its truth value is reverted Equation (8) or it disappears from the antecedent Equation (9) because its significance for '*B* is true' is defeated to zero. Furthermore, the variant Equation (10) is researched where the defeated value is changed by another formula.

$$\frac{\mathcal{B} \leftarrow \Lambda\_{i=1}^{z} A\_{i\prime} \mathcal{C}\_{\prime} E(\mathbf{c}\_{\prime} A\_{k})\_{\prime} \neg A\_{k} \leftarrow \mathcal{C}}{\mathcal{B} \leftarrow A\_{1} \Lambda A\_{2} \Lambda \cdots \Lambda\_{k-1} \Lambda \neg A\_{k} \Lambda \cdots \neg A\_{z}} \tag{8}$$

$$\frac{\mathbb{C}\angle B \leftarrow \Lambda\_{i=1}^{z} A\_{i\cdot} E(\mathbb{C}\angle A\_{k})}{B \leftarrow A\_{1}\Lambda \cdot \cdots \cdot A\_{k-1}\Lambda A\_{k+1}\Lambda \cdot \cdots \cdot A\_{z}}\tag{9}$$

$$\frac{\mathbb{C}, B \leftarrow \Lambda\_{i=1}^{z} A\_{i}, E(\mathbb{C}, A\_{k})}{B \leftarrow A\_{1}\Lambda \cdots \cdot A\_{k-1}\Lambda (A\_{k} \forall \mathbb{C}) \Lambda A\_{k+1} \cdots \Lambda\_{z}} \tag{10}$$

One of the frequently used health cases is where both antecedent and consequent are changed in the defeated rule. The other frequent case produces a fact from the defeated rule, and this fact contains a non-implicative relation. The defeasible process explores non-classical rule forms, one of them is '*Ak* is defeated if *C* is true in *E*(*C*, *Ak*)'. Detailed information concerning this topic is given in book chapter [25].

The defeasible reasoning is applied to test the strength of the investigated process and of its significant features. The quoted binding and pointing constraints significantly improve the defeasible processes. The pointing (indicating) constraints are applied in order to determine both the distance to the goal and the direction of the research. Furthermore, the history of the research process can influence on the pointing direction.

The group of pointing constraints can be considered as a generalization of the classical systems of goal/target or fitness functions. In contrast to the classical cases, pointing constraints are data-driven by nature and revert to being direction-driven with accumulated data. For example, if there is information that there was a pain, the data on its coordinates are probably no longer valid. In this case, the exact conclusion is in doubt until enough proof is accumulated.

The third researched constraint is named 'crossword'. It is depicted by the triple *A*, *C*, *E* in Figure 10. This type models the process of reasoning on the unknown things based on the accumulated knowledge. In such a way, parts of the searched goal have been found, and by using original evolutionary Puzzle method, a trial to complete the whole solution is attempted. The internal links between the elements of *A*, *C*, *E* are studied using different combinations of the quoted binding and pointing modeling.

Many algorithms and data-driven approaches were investigated with the aim to find any binding or pointing solution enlarging the set of the known part from *G*1. Generally speaking, every pointing constraint was used aiming to diminish the set of selected/processed data and knowledge: the 'selection focus' should be narrowed. Pointing to a certain part of the binding area improves the reasoning process.

On the other hand, in mobile signal processing applications, the pointing constraints show to the center of corresponding binding area. The binding cases frequently concern best signal processing practice, good medical practice, and many analogical examples. In many cases, little but important signal changes may be traced in this way, where neurofuzzy deep learning methods are successfully able to be combined with binding approaches. For example, the pointing constraints have been used for descriptions and maximization of the effectiveness of specific brain–computer interface features and communications to other medical procedures and devices.

Please note that the good practice examples were researched in coordination with possible bad practice situations, where they are described by using a combination of pointing and binding constraints. The considered novel modeling by using constraints does not change, in any direction, the considered biomedical research schemes but improves the effectiveness.

#### *9.2. Analysis on Preprocessing and Postprocessing Features*

The pointing constraints in this article concern the research on interconnection of electromagnetic and thermal influence, the influence of thermal-located radiation on skin/brain aging, an exploration of possibilities of overreaction to mobile radiation in small groups of people, and the influence of emotional state of researched people to their reaction. Noise in the head, forgetting, loss of concentration, bad mood, and slight disorientation symptoms after the call are not the factors of the binding process but they should be further investigated one by one of in a group with other medical data.

The binding constraints aim to model the facts how the size of the overheated area is connected to the damage effect, why the spots T3, T5, and F7 are the most promising places to estimate the aging affects, and the possible influence of radiation and fields on brain tissue processes, some of them presumably unknown. Other binding modeling options concern the research on mobile radiation in smoke, wet, and dirty air environments, and the binding of high-level SAR signals to the spectral power of EEG/electromagnetic field absorbtion.

Human health problems are a result of long-term dynamic process in nonlinear, and dispersive tissues. Potentially important outcomes may be obtained during long-term research on the accumulated effects on humans after 20, 30, and even 50 years of mobile phone usage. This type of work could not be executed manually, Deep Learning (DL) should be applied instead. The proposed deep modeling approaches should help to trace and process tiny changes and gradually re-evaluate their significance.

Significant ANOVA variables should be reinforced by the proposed types of pointing and binding constraints aiming to improve the constant knowledge elicitation, accumulation and processing possibilities. In this way the principles of open systems had been applied to statistical type of research making it more data-driven. The good practice database contains facts that many people are using hands-free,microphone,Bluetooth and other options where the mobile device is far from the head. This does not mean that the problem has an easy solution: the same sort of radiation still remains just near the human body.

Aiming at long-term search the binding constraints are set to search allergic reactions, oncology-like or blood problems, stomach infections, pain picture, influenza history, and Alzheimer symptoms. The history before and after the active start of the mobile era should be compared. The earlier history of PC usage also is included in the research. As a result, human-like reasoning is inspired: the radiation implies slightly higher temperatures in skin and tissue, and how high should be this difference to be physically noticed by the patient in very cold or cold environment.

This is an experimental attempt to bind the mobile radiation to any noticeable influence on the human body. In the positive case the binding/pointing areas may be enlarged by using other types of constraints. If the patient has any specific problems just after the long calls, he should be analyzed in the lab aiming to bind the problem to mobile radiation as a research hypothesis.

The aging and other human body features depend on many personal factors and history. This is frequently used to oppose to many of the medical research data in the field. As a whole it is rather easy to prove or destroy any hypothesis from the scope in a narrow research concentrated only to one group of facts and features. The proposed deep modeling options helped us to escape from this situation.

The complex research involving DL in perspective will be processed by software agents. In such a way, the types of constraints should be changed depending on the situation. As a result, powerful data science will analyze symptoms in each case by using the accumulated medical data and knowledge. The early eradication of irrelevant medical facts and hypotheses should be preserved by the use of software agents.

The use of the proposed data-science techniques opens up the prospect of greatly reducing manual effort and paving the way for intelligent medical research that focuses on combinations made up of minor and ancillary aspects. Sometimes little details might alter the overall course of the investigation.

#### **10. Conclusions**

We developed a novel data-science technique to identify the detrimental impacts of electromagnetic radiation from mobile devices on the human body. The proposed method for analyzing heterogeneous data is based on mathematical and statistical methodologies (thermal imaging and electroencephalograms). The proposed solution combines the ANOVA statistical method with deep modeling and rapid preprocessing approaches, such as binding/pointing/crossword constraints. Several tests were conducted utilizing the Pwelch function of MATLAB software, both with and without a mobile device. Each experiment was 30 min long.

The resulting signals were filtered and classified into four frequency ranges: delta (1–4 Hz), theta (4–8 Hz), alpha (8–13 Hz), and beta (13–32 Hz). The accuracy was determined for each frequency range with and without a mobile device based on the collected signals. The findings demonstrate that the emission of electromagnetic radiation from mobile devices has an effect on the signal frequency range accuracy. The presence of irradiation leads to an increase in the amplitude of brain signals in different frequency ranges. Furthermore, the results show that improved accuracy was reached without the use of a mobile device for each frequency band.

The proposed approach has limitations because it increases the computational complexity due to obtaining heterogeneous data. However, this issue can be resolved using a data-mining approach. In the future, different Quality-of-Service parameters (e.g., energy consumption, time complexity, and reliability) will be examined in the future. Furthermore, the proposed approach will also be compared to state-of-the-art approaches: IoT based mobile monitoring framework for hyper-local PM2 [1], and cognitive emotion pre-occupation method [38].

**Author Contributions:** M.G., conceptualization, writing, idea proposal, methodology, and results; V.J. and I.G., data curation, software development, and preparation; A.R., Writing, results, software development, preparation, submission, review and editing; M.A. and B.A., review, manuscript preparation, and visualization; D.B. review and editing. All authors have read and agreed to this version of the manuscript.

**Funding:** This work is supported by the Bulgarian National Science Fund, project title "Synthesis of a dynamic model for assessing the psychological and physical impacts of excessive use of smart technologies", KP-06-N 32/4/07.12.2019, led by Magdalena Garvanova.

**Institutional Review Board Statement:** Not applicable.

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** The data that supports the findings of this research is publicly available as indicated in the reference.

**Acknowledgments:** This work was supported by the Bulgarian National Science Fund, project title "Synthesis of a dynamic model for assessing the psychological and physical impacts of excessive use of smart technologies", KP-06-N 32/4/07.12.2019, led by Magdalena Garvanova.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **References**

**Disclaimer/Publisher's Note:** The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

### *Article* **A Flexible Session-Based Recommender System for e-Commerce**

**Michail Salampasis 1,\*, Alkiviadis Katsalis 1, Theodosios Siomos 1, Marina Delianidi 1, Dimitrios Tektonidis 1, Konstantinos Christantonis 1, Pantelis Kaplanoglou 1, Ifigeneia Karaveli 1, Chrysostomos Bourlis 2 and Konstantinos Diamantaras 1**

**Abstract:** Research into session-based recommendation systems (SBSR) has attracted a lot of attention, but each study focuses on a specific class of methods. This work examines and evaluates a large range of methods, from simpler statistical co-occurrence methods to embeddings and SotA deep learning methods. This paper analyzes theoretical and practical issues in developing and evaluating methods for SBSR in e-commerce applications, where user profiles and purchase data do not exist. The major tasks of SBRS are reviewed and studied, namely: prediction of next-item, next-basket and purchase intent. For physical retail shopping where no information about the current session exists, we treat the previous baskets purchased by the user as previous sessions drawn from a loyalty system. Mobile application scenarios such as push notifications and calling tune recommendations are also presented. Recommender models using graphs, embeddings and deep learning methods are studied and evaluated in all SBRS tasks using different datasets. Our work contributes a number of very interesting findings. Among all tested models, LSTMs consistently outperform other methods of SBRS in all tasks. They can be applied directly because they do not need significant fine-tuning. Additionally, they naturally model the dynamic browsing that happens in e-commerce web applications. On the other hand, another important finding of our work is that graph-based methods can be a good compromise between effectiveness and efficiency. Another important conclusion is that a "temporal locality principle" holds, implying that more recent behavior is better suited for prediction. In order to evaluate these systems further in realistic environments, several session-based recommender methods were integrated into an e-shop and an A/B testing method was applied. The results of this A/B testing are in line with the experimental results, which represents another important contribution of this paper. Finally, important parameters such as efficiency, application of business rules, re-ranking issues, and the utilization of hybrid methods are also considered and tested, providing comprehensive useful insights into SBRS and facilitating the transferability of this research work to other domains and recommendation scenarios.

**Keywords:** next-item and next-basket recommendations; graph-based recommendations; purchase intent; e-commerce; LSTM-RNN

### **1. Introduction**

A pleasant online shopping experience depends on factors such as convenience, comfort, product findability. Some of these constituents of success rely on researchers conducting usage analysis of an e-commerce application in order to improve its design [1], with these factors ranging from good typography, product photography and elegant and clean checkout forms, to personalized website structure [2]. Others, such as managing information overload, finding interesting, and related or alternative products in e-commerce sites, depend on good retrieval and recommendation methods [3]

**Citation:** Salampasis, M.; Katsalis, A.; Siomos, T.; Delianidi, M.; Tektonidis, D.; Christantonis, K.; Kaplanoglou, P.; Karaveli, I.; Bourlis, C.; Diamantaras, K. A Flexible Session-Based Recommender System for e-Commerce. *Appl. Sci.* **2023**, *13*, 3347. https://doi.org/10.3390/ app13053347

Academic Editor: Andrea Prati

Received: 11 January 2023 Revised: 17 February 2023 Accepted: 23 February 2023 Published: 6 March 2023

**Copyright:** © 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https:// creativecommons.org/licenses/by/ 4.0/).

As a response to this last need, recommender systems (RS) have become fundamental tools for conducting effective e-commerce. They provide customers with personalized recommendations in searching for additional products. RS collect and model past user transactions, and potentially other features such as location, demographic profiles and other people's preferences. Several models for RS of that conventional type have been proposed and proved their efficacy. Some examples are content-based [4] and collaborative filtering [5] systems. These research methods make use of the long-term user profiles that are logged every time customers visit an e-commerce site.

However, these conventional RS methods have some important limitations. Firstly, in many e-commerce applications, long-term user models are simply not viable for several reasons: new users visiting for the first-time, or not being required to have user IDs, or choosing not to login for privacy or transaction speediness reasons will disrupt the functioning of these models. However, there are more drawbacks. Focusing on a community's long-term preferences ignores short-term transactional patterns, interest, and temporal shifts. This generally degrades ability to understand the intrinsic nature of a user's behavior in her/his current ongoing session.

To address these issues, session-based recommender systems (SBRS) have emerged. In the context of e-commerce, a session can be seen as a single episode that includes visiting several web pages and viewing items, ending potentially with multiple purchased items in one shopping transaction. The same idea can equally serve other domains such as in linear TV programming [6], next point of interest assessments (POI), or movie and next song recommendations. SBRS solely rely on session-specific information and the user's most recent activities. The most recent interactions the user has had with the web application, or other sorts of information that may be acquired or inferred during a session, should thus be the basis for successful suggestions. These details may include, for example, how a user arrived at the website, how long they stayed on previous pages, short-term community popularity patterns [7], browsing patterns [8] or the ability to predict a customer's intent in real time [9]. A simpler SBRS strategy is to merely utilize the currently available item and community-observed patterns, i.e., suggestions in the form of "people who viewed/bought this item also viewed/bought this item". However, more advanced session-based methods should consider all of the user's previous session activities in addition to the most recent item they have viewed. A thorough study of a current session may be performed by considering the possibility that additional action categories, such as searching, clicking, and cart viewing, were also included in these earlier acts.

The context we described above defines how to recommend in these scenarios. Another important consideration is to inquire what the main tasks are within these scenarios, in other words what can be recommended. The next-item or the next-basket recommendations are candidate tasks, depending on whether the recommended items are for the current running session or for the next one, respectively, if session boundaries are defined. The following events or actions should be recommended if there are not any obvious session boundaries, as in music listening apps (recommend the next movie to be watched).

Another important task in e-commerce is to establish a model of how customers behave, and to predict during a session whether the user has real purchase intent or to determine the cart abandonment probability in real time. If these events could be predicted effectively, then conversion rates would be improved if marketing would be applied and incentives would be offered. Examples of such stimuli are coupons, price discounts that are valid for a short period, and other incentives. In fact, various recommendation tasks can run complementarily to preference assessments.

Flexible recommendation systems (FRES) https://www.fres-project.gr/, accessed on 20 February 2023, refer to a three-year research project that was funded to investigate the effectiveness of several methods and algorithms for SBRS in e-commerce, retail and web services. Several datasets and settings were used to test the effectiveness and the robustness of various SBRS methods in various tasks, namely in establishing next-item, next-basket and purchase intent [10]. Additionally, a testing component was integrated into

an e-commerce site to allow evaluation in a realistic environment. Additionally, several recommenders have been tested in mobile applications. Another aim was also to study the efficiency and other practical parameters, such as the training parameters, processing, and maintenance costs of different SBRS methods.

At the beginning of the project, we studied the concept of modeling anonymous sequential interactions in e-commerce and reviewed relevant prior work. Afterwards, we implemented and tested various forms of SBRS methods. Several types of recurrent neural networks (RNN/LSTM) were created, and their models were evaluated alongside those of other session-based recommenders that utilize various embedding techniques to represent items (Item2Vec, Doc2Vec). Furthermore, we proposed a framework to enable the hybrid application of text and product views sequences. Additionally, the core LSTM model was extended by adding an embedding layer before the LSTM layer. Finally, we used various reranking methods to improve the results of the basic recommenders using item categories.

To investigate reports claiming that recommendation methods using relatively simple statistical co-occurrence analysis are quite effective, we also developed a graph-based model for item recommendations. This method exemplifies a balance between the data processing and management requirements and the effectiveness of the recommendations produced.

Another challenge we examined during the project was the prediction of the shopping intent of e-commerce users using only the short-term browsing pattern of a user. LSTMs have been used recently in the e-commerce domain to improve recommendations; however, they have been barely used to predict a user's buying intention. In that regard, our study contributes to a better understanding of the LSTM approach for predicting the purchase intent. More precisely, we examined whether the e-commerce scenarios in which RNN-LSTM could provide better results in comparison to more conventional ML techniques, which have been considered as the SotA for the purchase intent task.

This paper presents the main results of the FRES project. The methodology of our approach is outlined in Figure 1. The major challenges and problems of SBRS that are addressed by our research work are the following:

**Figure 1.** The methodology of a flexible recommendation system. It involves the use cases of "e-commerce", "web services" and "physical retail store" (yellow boxes). The relevant tasks for each case are shown in blue boxes. They are the prediction of the next item in an online session, the prediction of the intent to purchase, and the prediction of the next basket. The arrows indicate the relationship between the tasks and the corresponding use cases. The methods used to solve these tasks are shown in the green boxes. These include recurrent neural networks and graphbased methods using either statistical co-occurrence analysis or node similarity assessments. The methods are in turn based on the representation of the data. The representation can be used to make additional determinations.

The development of a flexible SBRS system that is based on a common set of principles and methods to address the variety of problems in session-based recommendation systems and physical retail shops. These problems/tasks are next-item recommendation, purchase intent prediction and next-basket recommendation.

The performance of a comparative study of SotA methods from different domains, including neural networks and graph methods.

The identification of a set of efficient and general methods for representing the history of user activity such as session data and basket data history.

The paper is structured as follows: Section 1 discusses earlier work. We go through the tasks and the methods we propose to solve them with in Section 2. The numerous datasets we produced to assess our techniques are shown in Section 3. We provide a description of the experiments, as well as a report and discussion of the findings, in Section 4. In Section 5, we summarize the results, point out challenges and issue a plan for the advancement of SBRS in the future.

#### **2. Methods and Literature Review**

In this section, we present the tasks that are addressed in this paper and the tools and methodologies that were used to tackle problems and challenges related to these tasks. For all these methods, we discuss major relevant literature that shows how each method has been developed and what the current state of the art. In particular, Section 2.1 describes the task of predicting the next item and the last item in a session using the prior user behavior within this session. Section 2.2 discusses graph representations methods for recommendation systems. Section 2.3 discusses the task of purchase intent, which seeks to explicitly determine whether the intent of the user in the current session is to purchase some product or not. Section 2.4 describes the evaluation metrics used in the subsequent experiments. Section 2.5 presents the SBRS methods that we employed in various practical scenarios.

#### *2.1. Next-Item, Last-Item Tasks*

Early recommendation methods used simple pattern mining techniques. These techniques are easy to implement and lead to interpretable models. However, the mining process is usually computationally demanding. Furthermore, several parameters of an algorithm should be fine-tuned, and this might be difficult. Moreover, in some application domains, frequent item sequences do not lead to better recommendations than when using much computationally simpler co-occurrence patterns [11].

After these first experiments, more complex approaches based on context trees [12], [13] reinforcement learning [14], and Markov decision processes [15] were developed. The number of prior interactions (i.e., history window) that should be taken into account while estimating the following interaction was a parameter used in these recommender models.

Word2Vec/Doc2Vec methods were developed for use in linguistic tasks, but they can also be applied in recommender methods for CF [16]. Word2Vec is a two-layer neural network which is trained to represent words as vectors in such a way that words that share common contexts in the training corpus are located in close proximity to one another in the space. These representation vectors are known as embeddings. There are two varieties of Word2Vec called CBOW and skip-gram, with the second one being the most common approach. Skip-gram predicts the context of a word, *w*, given *w* as the input. Doc2Vec is based on Word2Vec with the aim of creating vector representations of documents rather than single words. Doc2Vec creates paragraph vectors by training a neural network to predict the probability distribution of words in a paragraph given a randomly selected word from it.

Word2Vec can be generalized to represent items with vectors based on their context (i.e., other items in the same session or basket) in a very similar fashion to its means of assigning vector representations to words. It can infer item–item relationships even in the absence of user ID information. The item-to-item recommender system (Item2Vec) is initially trained using the item sequences from prior anonymous user sessions. Then, when the system is actually applied, it accepts the currently selected item as input and produces a group of related things based on the input. In fact, when compared to SVD and other sequence-based CF approaches, this method yields results that are competitive [17,18].

Deep neural networks have recently been suggested for recommender systems. In particular, recurrent neural networks (RNN) have been very effective models for session data of user interactions. Recurrent neural networks are extensions of feedforward networks with additional internal memory. They are created by adding a feedback loop from the output back to the input of the network. As a result, the current output depends on both the input and the previous output. The fundamental benefit of RNNs over other approaches for recommendation is that they can naturally and incrementally model series of user interactions. After creating a predictive model, RNNs offer more effective recommendations than other sequence-based conventional techniques [19,20].

#### *2.2. Graph-Based Methods*

The use of graph databases (GDBs) is a new approach for data modeling [21]. A graph database represents data entities as nodes and their relationships as directed connections between nodes. Neo4j is an open source graph database tool that supports semi-structured hierarchically organized data [22,23]. The graph using this method is used to represent sequences of items in a session using node relationships. Thus, it becomes another way to represent item sequences.

Neo4j was used for creating various recommendation systems, making recommendations of friends, movies, and objects, and also in the field of e-commerce. Konno [24] developed a recommendation system based on data-driven rules. They applied a two-layer approach to retail business transaction data for business information query and reasoning. Another graph-based and rule-based recommendation system approach was described by [25]. Delianidi [26] presented another graph-based recommender using Neo4j in which emphasis was given to efficiency. In this work, nodes and relationships between the nodes were defined using session training data. The system finds all pairs of co-occurring items in the current session by running cypher queries. Then, the similarity between the items of the pair can be calculated using these co-occurrence frequencies.

#### *2.3. Purchase Intent Task*

In all likelihood, the first techniques tested to determine whether or not a user session in an e-commerce application is likely to end with a purchase were multilayer perceptron classifiers and simple Bayes classifiers [27]. Suchacka [28] used data from an online bookstore to evaluate SVM using a variety of factors (23), with a similar goal of classifying user sessions as either browsing-only or purchasing-related. The most effective SVM classifier showed high performance. It achieved a likelihood of predicting a purchasing session of about 95% and an overall prediction accuracy of 99%.

Association rules and a k-nearest neighbor (k-NN) classifier were used by [29] to enhance their study and estimate the likelihood of a purchase. To predict purchase likelihood for two client groups—traditional consumers (accuracy 90%) and more diverse–novel customers—they employed basic association rule mining and other behavioral knowledge (accuracy 88%).

The hidden Markov model (HMM) is another method that was tested. In fact, there are many web usage mining research efforts that have considered HMM to predict user behavior in several settings and for different tasks. Examples of its uses include deciding if a web search session was successful or not, establishing recommender systems [13], or making suggestion for the next point of interest in tourism websites. Ding [2] presented a research study that was more related to our work; however, it primarily made use of HMM to understand customer intent in real-time in order to make web page adaption.

Using user activity data, participants in the RecSys2015 competition attempted to estimate the assortment of goods that would be purchased during a session. The stateof-the-art (SotA) solution for this issue remains the two-stage classifier provided by the competition winners [30]. While the second classifier predicts the things that will be purchased, the first classifier predicts whether at least one item will be purchased during the session or not. In this work, the session and click dates, click counts for individual things, and other category features of the sessions and objects were employed.

Recurrent neural networks (RNN) were utilized by [31] to capture event dependencies and connections for user sessions of arbitrary length, both within and across datasets. Results from the RecSys15 challenge indicate that their solution performed admirably well. The key benefit of their approach is that it needs reduced domain- or dataset-specific feature engineering.

Another RNN-LSTM-based system for analyzing online shopping behavior was present-ed by [9]. It had two parallel-operating components. The first predicted consumers' tendency to shop; however, this module employed machine learning classifiers such as random forest, support vector machines, and multilayer perceptron. RNN-LSTM is only used in the second module, which predicts the likelihood that users would leave a website without buying anything. In relation to the SotA, their purchasing intent module performed much worse. The accuracy of the second module, which predicted website desertion after a short window of three-user action, was almost 75%.

A full connected long short-term network (FC-LSTM) for modeling the interactions between customers was tested by [32]. The same network models the nonlinear sequence correlations and cumulative effects between customer's browsing behavior. However, to attain better predictions, they use more features from user profiles, including purchase history and demographics.

#### *2.4. Evaluation Metrics*

One of the most common evaluation metrics used was the mean reciprocal rank (MRR). Its calculation formula is:

$$MRR = \frac{1}{Q} \sum\_{\chi}^{Q} \frac{1}{\text{rank}(\chi)} \tag{1}$$

where *Q* is the number of queries we are considering, and rank is the position of the correct answer *x* among the returned values, with rank(*x*) = 1 if x is the first item in the recommendation list. When there is no correct answer within the recommendation list, then we set rank(*x*) = ∞ and the reciprocal rank 1/rank(*x*) equals zero. In our case, the MRR varies between 0.017 and 0.03 depending on the number of responses we return.

Another evaluation metric used in our experiments is the F1 score @ k, which equals the F1 score of the recommendation list containing k items. The F1 score is the harmonic mean between the precision and the recall, defined as

$$F1 = \frac{precision \cdot recall}{(precision + recall)/2} \tag{2}$$

where *precision* = *tp tp*+*f p* , *recall* = *tp tp*+*f n* , and *tp* = true positives, *f p* = false positives and *f n* = false negatives.

#### *2.5. Tested SBRS Methods and Practical Scenarios*

#### 2.5.1. Content-Based SBRS Using Doc2Vec Embeddings

This approach is similar to traditional content-based systems in that it suggests products that are pertinent to previous "liked" things by the user [4]. The similarity is calculated on basis of the text content or other attributes of the items liked by the user. Note that the term "liked" can take several interpretations depending on the domain, application, or other context. In the context of SBRS, the items visited in the current ongoing session provide input content to the recommender.

In our project, we created a vector for each product item using the title, color, and extended description. A fixed dimension vector for every item was produced using the Doc2Vec model. We created an n-dimensional vector for each item after training the Doc2Vec model using the textual descriptions of the products. Following multiple experiments, vector sizes of 500 for the next-item dataset and 100 for the last-basket dataset were chosen. In this method, the similarities to all other things are computed for each viewed item during an ongoing session to suggest the next item. The cosine similarity measure gave slightly better results in all the datasets we tested.

#### 2.5.2. Item-Based SBRS Using Item2Vec Embeddings

This approach is a Word2Vec technique transfer to the SBRS problem. To learn distributed representations of words, the Word2Vec approach was first used in natural language processing.

Item2Vec provides embeddings to things in a manner that is very similar to providing embeddings to words [16]. The underlying idea is that it can be used in the sense of collaborative filtering to provide recommendations, despite user IDs not being available. The Item2Vec method uses item views like Word2Vec to process the sequence of words; in this process, the word sequences match to the users' sessions while they browse an online store (sentences). Our technique utilizes Word2Vec's skip-gram variety of Word2Vec. As such, the underlying assumption is that, given a sequence of previously visited items in an ongoing session, the task is to predict the next item(s).

We tested several embeddings by increasing the sizes of vector dimensions, but the best sizes were 30 for the next-item task/dataset and 100 for the next-basket task/dataset. L2 norm achieves better results when measuring the similarity between items in the first dataset, whereas cosine similarity produced better results in the second dataset.

#### 2.5.3. SBRS Methodology Using Embeddings

When implementing recommendation methods relying solely on the ongoing session, there are several decisions that should be considered on how to execute such operation. For example, how many previous actions of the ongoing session should be accounted for in the prediction? Or, how the previous actions will be summarized of the ongoing session to represent the behavior so far? The following list outlines all these steps and the parameters that are typically involved.

We conducted several experiments in our project to assess how these criteria might affect the results. In order to obtain the vector u, we averaged the embeddings of either the last n items the user viewed during a current session or all of the products they purchased in the previous n baskets. We conducted a number of tests and found that the "temporal locality principle" typically holds. Results are improved when only the most recent items are taken into account; in other words, recent behavior greatly outperforms activity from the session's very beginning in terms of predicting the next action. In general, all SBRS approaches perform better when a smaller memory of the user activities is taken, as we shall demonstrate later.

#### 2.5.4. Hybrid Methods

Systems aggregating both collaborative filtering and content-based methods are called hybrid recommenders [33]. In our research, we explored if the two embedding techniques we created could be used together to operate a hybrid usage of text and item sequences. In particular, our system combines the browsing patterns of all sessions, together with

the model that is developed based on item's text, using the Item2Vec and the Doc2Vec methods, respectively.

The two methods produce their predictions inside their vector space. The vectors generated by the Item2Vec method are located in one vector space, whereas those generated by the Doc2Vec method are found in the other. Both techniques estimate item similarity using the cosine similarity. The range of cosine similarity is [0, 1]. Therefore the closer the value is to 1, the stronger the similarity and prediction will be. Given that cosine similarity has a range of [0, 1], the stronger the similarity and pre-diction is, the closer the result will be to 1. In our hybrid approach, we compute the combined prediction using v = [1-CosineSimilarity]. The values' range is still [0, 1] in this instance, but the prediction is now greater the closer a value is to 0.

For each of the two methods, we multiplied the value of v with the rank of the item in the recommendations list. The product indicates the confidence each method gives the recommendation. Finally, we combined the Item2Vec and Doc2Vec confidences to calculate the final prediction value.

#### 2.5.5. Graph-Based SBRS

In our project we implemented two SBRS methods using Neo4j. The first method, called pair popularity, models in the graph all item co-occurrences found anywhere in the same session. Having recorded the item P viewed by the user at session step t, the method recommends a list of items for step t+1 based on how often the items co-appeared with P in the training sessions. Later, we proposed the hierarchical sequence popularity (HSP) recommendation method. This method uses a hierarchical representation of item sequences in user sessions to further improve the results and produces significantly better results. To recommend an item, we looked at its frequency of appearance as well as the history of sequences of length 1 or 2 in which this item participated during the training sessions. In the absence of history (i.e., in the first step of a session), items were recommended based on their popularity. Both recommendation approaches can be applied to a wide variety of e-shops regardless of the type of items. The item recommendations that the methods offer can be used as an essential component to automate and improve the identification of related items for the online customer.

The main advantage of graph-based recommenders is that they quite are effective, but at the same time are efficient when considering the complete operation cycle of SBRS (data gathering, modeling, processing, analysis, filtering). Graph-based SBRS, due to their underlying architecture, can incrementally collect data from an e-commerce website from all ongoing user sessions. Moreover, these data are immediately available to the recommendation algorithm because no training phase is required. Finally, it is easy to integrate new business rules and constraints on demand, something that is more difficult to inherently implement using ML methods.

Generally, scalability is a critical issue that should be very carefully considered, especially when building SBRS for big data. If a method is very effective, but it requires a substantial amount of training time exceeding the periodic time in which the recommender prediction model should be updated (every day or every week), it is not applicable.

#### 2.5.6. SBRS Methodology Using LSTMs

In a typical architecture of an LSTM recommender, the recently visited item(s) of the ongoing user's session are the input. The output is the next item to be recommended using the system's one-hot encoding. Compared to all the other methods, this one has actually produced strong results. At the conclusion of the model's 20-epoch training process, we obtained the best score by utilizing 200 hidden units for the LSTM layer and a Softmax layer with a size of 1097 units for categorical cross-entropy loss. Figure 2 shows the architecture of this recommender.

**Figure 2.** LSTM design in the next-item task.

For the last-basket job, the user's previous baskets provided the input. The average Doc2Vec vector of the items inside each basket was used to represent each basket. We received a sorted list of all the probabilities for each item as the result. The best F1@2 score for the model's hyperparameters was obtained using 300 LSTM units, 100-dimensional Doc2Vec vectors, and 100 epochs.

An additional embedding layer was added to the LSTM recommenders to improve their performance (Figure 3). In particular, we expanded the approach by using the vectors we trained with Doc2Vec as the initializing weights of the LSTM. As compared to our basic LSTM approach and our hybrid technique (which combines Item2Vec and Doc2Vec), this expansion provided an overall improvement in MRR of up to 10% and up to 100%, respectively.

**Figure 3.** LSTM architecture used in the last-basket task.

2.5.7. SBRS and the Purchase Intent Task

Our method for predicting purchase intent modeled all user actions as a sequence like in our recommenders. However, it differed in that we applied extra features. Specifically, one such feature was the time (in seconds) the user spent in each action. We also used four other features (season, day, working hours, origin). These extra features were important for an e-commerce application as other studies have shown that buying behavior changes over time [30]. The feature Season specifies a high season (autumn/winter for leather apparel) or not. We also know that a purchase is more likely to be made on the weekend, and that visiting an e-commerce application in midday hours usually results more purchases than in the night hours.

Nevertheless, the main difference in the purchase intent task is that we retrieved and modeled all user actions, and not only the View Item actions, as we did in our recommenders. All user actions belong in one out of the twelve action types. These twelve action types include all potential actions that customers do in e-commerce web applications. As

such, hence they may be seen as a "standard" set of action types for other studies in the e-commerce domain. Table 1 shows all user action types modeled and their frequency in the dataset and in each of the two session types we wanted to predict. Most of them are self-explanatory. The action type "Concerned" means that a user has visited a web page reflecting a customer concern about privacy policy, payment security or product shipping and returns. The "Recommend Product" action signals the recommendation of a product to another person by sending an email message.

**Table 1.** User action types.

In this task, each event is represented with a vector and each session is modeled as a sequence of events. A sliding window, starting from the first session action, designates the context of each user movement and it is exactly this context window that it used as a sample for training (Figure 4). The length of the window (N) is a parameter of our method. If the window ends inside the first N-1 events, the previous navigation steps apparently remain fewer than the size of window. In this case, the empty slots are taken as zeroed events.

Similarly, for each input instance, the output is computed using the remaining events. Specifically, for every occurring event, Ei, our method calculates the outcome after considering all the remaining events until the end of the session. The target is modeled as a 2-digit enumeration structure. Each binary digit independently represents one of the two actions of interest (i.e., add cart, make order). Thus, in total there are four outputs possible. Two of them, [1, 0] and [0, 1], signify that at least one add-cart or one purchase event occurred, respectively. The existence of both events is the output [1, 1]. If both these two events do not occur in the remaining segment of a session, the output is coded as [0, 0].

To summarize, our purchase intent system is modeled as a multilabel classification problem that determines, for each session action, the result of the rest session. The following four scenarios outline four different outputs:

2.5.8. Last-Item (Calling Tune Recommendation) Task Using the Node2Vec Method

In this task, we used a different method called Node2Vec, inspired from bio-informatics. The Node2Vec framework learns low-dimensional representations for nodes of a graph using random graph walks starting at a target node. This method requires the creation of a graph where the associations between the various entities—in our application, the main entities were users, songs, artists, genres—are represented as arcs. After creating the graph by applying 2nd-order random walks, numerical representations for each node within the graph can be produced. These representations are finally used as input to the classic word2vec algorithm (skip-gram model with negative sampling) to derive the final embeddings of each node. In essence, the resulting embeddings preserve the structure of the original network in the sense that related nodes have similar representations.

The key characteristic of 2nd-order random walks is that each transition to a neighboring node is accompanied by a probability, defined as a hyper-parameter, different from that of returning to the previous node. This particular methodology requires the user to define a series of hyper-parameters that control the process mainly in terms of complexity. These basic hyper-parameters are the following: number of walks, walk length, return value to the previous node (return hyper parameter—*p*), and transition value to a new node (in-out hyper parameter—*q*). The last two parameters concern the transition between nodes during the random walks phase.

When implementing this method, we had to solve several efficiency and scalability challenges. Initially we used the python library NetworkX to create the graph. NetworkX is the most common open source package for creating and editing graphs in python. Nevertheless, the specific method in its basic implementation, although highly effective, is not scalable enough due to memory (RAM) problems. This is because 2nd-order transitions increase the number of total transition probabilities quadratically with respect to the number of edges within the graph. For this reason, another implementation of this method called PecanPy was used which largely solves memory sufficiency problems. In essence,

PecanPy solves the problem of parallelizing the two otherwise parallel processes, i.e., the preprocessing of the transition probability from each node, as well as the random walk application.

#### **3. Datasets**

In terms of data, the problem of SBRS becomes complex. There are several data items and certain feature selection, and session and feature engineering will be needed. The item (product, movie, tune, etc.) is the central concept, however the presence of the session concept and the potentially different domains, bring extra complexity. For example, selected past sessions may be characterized as irrelevant to the current ongoing session. The item concept in e-commerce will normally be a tangible product. However, item in the music domain will be a song. Additionally, tasks like the purchase intent or the requirement to address the temporal locality principle (i.e., make recommendations that predominantly reflect recent behavior) bring even more complexities.

Furthermore, a dataset in SBRS research should have a clear session structure. The session structure may also present a clear ordering of the events that occur within a session. If a sequence of the events is explicit in the dataset, then this dataset is best fitted for next-item tasks. Sometimes, session boundaries may be clear; however, the sequence of events within the session are not specified. For example, in a shopping cart dataset, each shopping basket has clear session boundaries which distinguish it from all the other baskets, and so it naturally represents a session. The recommendation tasks on such dataset can be next-item(s) or next-basket recommendations. However, it should be noted that the entire basket session should be considered in its entirety. This because we do not know the sequence in which a user has put these items into the basket. For all these reasons, such a dataset is better suited for the next-basket task and is totally unsuitable for the purchase intent task.

Our experimental work in the project was driven in part by the views we discussed above, but mainly by the funding requirements to deploy, apply, and evaluate our developed methods in real e-commerce environments for a long duration.

Many experiments reported in this paper used data that were extracted from the web server logs of an apparel e-commerce website for a relatively long period of time (a few months). The log data were analyzed to identify sessions, session length, user actions in each session, actions' related items, item categories, and time spent on each action. As a result of this preprocess, the first dataset we produced (Dataset A) consisted of 24,111 sessions that altogether counted 312,912 user actions. Twelve different action types exist overall, but all the events were utilized only in the purchase event task. The 728 sessions ending in purchases represent a 3% conversion rate. In 22,008 sessions, users did not have any items in their shopping cart when they exited, meaning that 91.2% sessions were browse-only. The rest of the sessions had items in their shopping cart when they finished, but these never turned into purchases. In the next-item experiments reported in Section 5, we included only the "View Product" user actions and only the sessions holding at least two different item views, finally collecting a number of 12,128 applicable sessions consisting of 67,101 "View Product" user actions.

The above dataset was further processed to create another variation (Dataset B) suitable for the purchase intent task. In this second dataset, we used all event types listed in Table 2, but we kept the sessions that had at least 3 behavior sequences. This preprocessing led to the final dataset containing 21.896 sessions, including 258.101 user actions (the size of each session was 11.7 actions in average and the Median was 8). The average size of Browsing, Cart Abandonment and Purchase sessions are 11, 18.8, and 19.5, respectively. The 689 purchase sessions make a conversion rate of 3.14%. In 90.9% of sessions (19.902), users did not add any items to their shopping cart. In 1305 sessions, users added items to their shopping cart, albeit without completing a purchase. Table 2 shows all user action types and their frequency in the complete dataset.

**Table 2.** Results of all recommender methods for next-item and next-basket task.

\* all (column 5) denotes a session "history" of 35 items max.

The third dataset we created (Dataset C) reproduces the next-basket scenario and it is also built on a real application. It contains purchased items (in baskets) from a petshop store. The dataset has 40,203 transactions (baskets) belonging to 1493 users of which 1408 two or more baskets, i.e., they can be included in the experiment. The dataset contains 6626 items in total. The average length of all baskets is 2.26, therefore we calculate F1@2 in our results. Another parameter that we tested was the number of previous baskets to consider in predicting the last-basket content.

In later phases of the project, we installed a logging component into an e-commerce web application, and we collected data, although this time not from the web server logs but directly by logging specific user actions. For the experiments we report in the next section, this dataset (Dataset D) was processed to obtain only the sessions that contain the "View Item" and "Add to Cart" actions, resulting in 102.024 records. A typical split into train (80%) and test (20%) datasets was performed. Thus, the train sessions are 81.651 and the test sessions 20.373. The total number of unique sessions is 19.236 which corresponds to 15.388 sessions in the train set and 3.848 unique sessions in the test set. The dataset contains 1448 unique items, of which 1429 appear in the train set and 1296 in the test set.

One last dataset we used was the one for the calling tune recommendation task using the Node2Vec method (Dataset E). The data for this task fall into one of these entities: user, song, artist, and genre of music (user\_id, item\_id, artist\_id, genre\_id). Initially, the construction of the graph required in Node2Vec was carried out by connecting all the correlations of the above fields with the central entity, which is that of the song/tune (item\_id). Specifically, the following associations were added to the graph: item\_id->user\_id, item\_id- >artist\_id, item\_id->genre\_id. It is worth noting that a graph created in this way is neither directed nor weighted. The initial dataset contained 662,698 instances. Many of the users appeared more than once and were the customers of interest to our method because users with a single transaction cannot be tested. For this reason, all records having users with just one transaction (tune) were removed and the final size of the dataset was reduced to 570,533 transactions. Then, to configure the train and test set, the following procedure was followed. The train set comprised all user tune records except for the last one, which was put in the test set. For example, if a user has 4 transactions, the first 3 are included in the train set while the fourth ends up in the test set. The size of the two resulting sets was 478,572 for the train set and 91,961 for the test set. The total training time of the model was in the order of minutes (5–10), which gives more value to this method.

#### **4. Results and Discussion**

Before discussing the results of each technique, we need make a few clarifications based on the experimental setting. Section 4 provides a description of the datasets. In the next-item task, we created a list of recommended things that executed all methods for each item in each test session.

If a method needs the sequence of the item(s) viewed hitherto, then this sequence is provided to the method. We estimate the reciprocal rank for each list that each method returns, which is a ranked list of n recommended item(s) (RR). In this manner, the RR for each test session's action is computed.

The mean reciprocal rank (MRR) of the entire session may then be calculated. Finally, the MRR of the approach can be calculated by averaging the MRR of all sessions that have been tested. The reason we choose MRR as the evaluation measure is because it expresses the effectiveness of a method to recommend the next-item as highly as possible in the recommendation list. If a method achieves an MRR of 0.25, then a recommender would require showing 4 recommended items to effectively include an item that could be selected with high probability.

The experiments described below were executed on a computer with an AMD Ryzen-9 CPU @ 4.9 GHz, 32GB memory, and a NVIDIA Titan Xp GPU card. The neural network models were executed on the tensorflow-2 platform, while Neo4j was used for the graphbased algorithms.

#### *4.1. Results of the Next-Item and Next-Basket Tasks*

In these experiments, 90% of dataset A was used for training and the remaining 10% for testing. A random split was repeated five times. The results reported here are the average of the results produced from each split. In the last-basket task, all available baskets were used both for training and testing. Specifically, all baskets, except for the last one, were used to train the last-basket prediction model. Then, the last basket of each user's baskets was predicted and compared to the actual last basket the user purchased.

The post-prediction reranking was inspired by the knowledge that several product categories dominate each customer's purchases. To apply this reranking method, we define the dominant category as the one with the most "hits" from the session's start. Once the prevailing category is determined after each user action, all the recommended items in the dominant category are top-ranked. In the table summarizing the results, this method is indicated as "with reranking".

The results of each method for the next-item (MRR) and the last-basket (F1@2) tasks are presented in Table 2. The column "last" shows the results if only the last item was taken as the context. The column indicated as "all" presents the results when the entire user behavior sequence, from the session start until the current item, is taken into account.

The LSTM methods produced considerably better results. The MRR was 0.265 when we initialized the LSTM recommender using random weights. The embedded layer which we added improved the performance only marginally. The Doc2Vec method was the best from the embeddings that we tested, attaining an MRR of 0.101. The Item2Vec method performed less effectively, having an MRR of 0.087. When the content-based and the item sequence embeddings were combined, they produced better results. Finally, our experiments confirmed the intuitive assumption that category-driven reranking improves the results, except in the LSTM method. We believe this occurs because LSTMs already capture the focus on specific product categories.

Table 3 also illustrates the results of the last-basket prediction task. Column 4 presents the F1@2 results, considering seven previous baskets as the purchase history. Column 5 illustrates the results when all the purchases are considered. In these experiments, the results are quite different from the next-item task. In the reverse of what happens in the next-item task, the Item2Vec method in this task performs much better than the Doc2Vec. This is due to the smaller textual information available in the items in this dataset. Quite surprisingly, Item2Vec outperforms the LSTM method when only seven baskets are considered; however, the performance order is marginally reversed with larger purchase history. Generally, all methods produce better results when a shorter purchase history is used. It seems that a principle of locality consistently holds which states that the next user action is influenced

more intensively by its immediate surroundings. Another interesting result is that categorybased reranking negatively affects all methods. We believe this outcome relates to the organization of the dataset which has very few categories.

**Table 3.** Accuracy Results (Window size = 10).

#### *4.2. Results of the Purchase Intent Task*

Dataset C was used in this task. A 10-fold stratified cross-validation procedure was applied. We found that the optimal settings are a 0.2 dropout rate, Adam optimizer and 500 LSTM units. Table 3 shows the results using window size N = 10. When we combined LSTM with a GRU layer, the performance was better in comparison to result obtained using one LSTM layer. This finding is in accordance with other studies on sequence modeling (Chung et al, 2014), in which combinations of LSTM and GRU variants outperform standard RNNs. At the end of the architecture, we used a dense layer with sigmoid function to deliver the final probabilities for multilabel prediction.

The results produced by our fine-tuned method are better than those from other similar research reported in the literature using RNN-LSTM. Additionally, the results are comparable to the accuracy results that SotA methods have achieved (Section 2.3).

The window size, i.e., the size of previous items considered as "history", is an important parameter for our method. To that end, we performed further experiments to test our model using different window sizes. The cart abandonment sessions are of particular economic interest for e-commerce applications because the user adds item(s) into the cart, but s/he does not complete a purchase in the end. An e-commerce application will benefit remarkably if these sessions are predicted during a session as early as possible. Table 4 presents the accuracy results as a function of multiple window sizes in two different conditions. The first includes all sessions, and the second considers only the "Cart Abandonment" sessions. The prediction of the cart abandonment sessions is less effective. Similar findings have been observed in other studies as a result of datasets containing many sessions that did not conclude with a purchased basket, and very few cart abandonment and purchase sessions.

**Table 4.** Accuracy results as a function of Window size.

#### *4.3. Results of Our Graph-Based SBRS*

Table 5 presents the MRR results of the proposed hierarchical sequence popularity recommendation method in comparison to the "simple" pair popularity graph-based recommendation approach and other recommendation methods using machine learning models (Item2Vec, Doc2vec and LSTM) in Dataset D.

**Table 5.** Results of the next-item task using the graph-based methods for SBRS vs. other ML/DL methods.

Between the two graph-based methods, the new HSP approach outperforms the pair popularity approach in both next-item recommendation scenarios by 3–4%. In terms of comparison with the machine learning methods tested, in the case of the Item2Vec and Doc2vec models, the HSP method prevails by a significant margin.

According to the experimental results, the method that produces the best results is the LSTM machine learning model. The HSP makes recommendations based on limited history and using a quite small memory window extending up to only two previous items. Nevertheless, the performance of the HSP method is very close to the LSTM performance. This is surprising because the LSTM is one of the most powerful models and is equipped with infinite memory capability, enabling maximal exploitation of the history data in a session to produce good recommendations.

#### *4.4. Results for the Calling Tune Recommendation Task using Node2Vec*

In the experiments using Dataset E, after fine-tuning, the final values of the hyperparameters discussed in 3.8 are the following: number of runs = 10, length of runs = 100, *p* value = 0.5, Q-value = 1.

A disadvantage of the way we implemented the Node2Vec method in this problem was that most nodes represented users. As a consequence, recommendations with the most "relevant" nodes always returned a large number of users. For this reason, there was a risk that, if the list of recommendations we requested from the graph was relatively small (of the order of hundreds), we would not receive recommendations concerning calling tunes. This was also the reason why MRR attained very low values. Table 6 shows how the MRR is shaped in relation to the number of recommendations and how many queries end up not returning any music as an answer.

**Table 6.** MRR results for the calling tune recommendation task.

In summary, the Node2Vec recommendation method solves the problem of tune recommendation, but at the same time it is a method that does not require high computational costs. Its evaluation, although it does not seem very impressive, in reality should be considered highly satisfactory for this type of problem. Its qualitative evaluation showed that

there is indeed a great relevance between the suggested tunes and the history of the user, regardless of whether s/he had not selected them up to that point in time.

#### *4.5. Push (Offers) Notifications Task*

The widespread use of mobile applications developed specifically for use on small, wireless computing devices, such as smartphones and tablets, has developed the need for recommender systems that can execute the core task of sending push notifications. A push notification is a message that is "pushed" from a back-end server or application to a mobile application. However, although some aspects are similar, push notifications cannot be managed in the same way that next-item or next-baskets recommendations are created in e-commerce. This is mainly because push notifications have to take into account several other factors that will determine the type of the message or the items that may be recommended inside the delivered message. Such parameters may include the need not to disturb the customer receiving the notification, but also other marketing strategies like promoting specific brands and marketing goals (Figure 5). Additionally, the situation for managing push notification messages is quite different, e.g., push messages may be ignored completely by the user, without even reading them. The final aim in assessing and criteria to evaluate a push notification strategy is the capacity to create push notifications that will be not rejected, will be read by users, but most importantly will activate links or recommended actions. In other scenarios, the aim is to lower customer churn, i.e., the rate at which customers will stop using an app or purchasing items with a company's e-shop over a given period of time.

**Figure 5.** Parameters determining a push notification policy.

In our research project, we implemented a push notification subsystem for a pet-shop (Almapet, refers to Dataset C in Section 4) and for a mobile lottery application. In the Almapet case study, the first objective was the exploratory analysis of the purchasing behavior of the pet-shop customers based on the history of their purchases from a physical store. The second objective was the prediction of the next purchases in order to recommend products that are relevant to a customer and can be the subject of personalized offers using notification messages. The training set included 1408 customers having more than 1 basket, a total of 40,203 baskets and approximately 6400 products. Two methods were used to categorize products. The first method was codenamed cat01 and used product categories (32 exist). The second method was named cat02 and was based on the producer. From the purchase history of each user, a vector representing the user's profile was created. Additionally, clustering revealed 10 customer groups and their preferences according to the animals they own, the items they buy most often and the brands they prefer. The

output of the clustering algorithm was used to produce a personalized prediction of the product categories each user buys (category relevance, see next paragraph) and the producers/brands they prefer (brand relevance, see next paragraph again).

The method overall takes as an input a user id and calculates: category relevance, brand relevance, items composing the next-basket, associated items (items purchased together), recent sales trends and finally the push policy, i.e., items and/or categories that are selected for promotion. Using a weighted scheme to assign a weight to each selection parameter, the management can decide its marketing strategy. For example, the aim to increase weights for category relevance, brand relevance and items composing the nextbasket places the emphasis on a customer's purchase needs. On the other hand, increased weights for the parameters associated items, sales trends and the push policy, increases the diversity, novelty and serendipity of the purchase behavior.

The second scenario regarding this push notification task builds around a mobile lottery application. The basic aim is to send push-promotion messages to increase the use of the lottery application. The strategy we used was to suggest new lottery games to mobile application users that were considered most likely to engage the recipient, with the following objectives:

This notification message component takes as its input the historical sequence of games that a user has played in the past and produces a recommendation about a game that a user has not played before. For this type of recommendation, we used the Word2Vec method. The training sessions, with each sequence of games played on by users being regarded as a session, are used to create and assign embeddings vectors for each game in the lottery application. Games that are played jointly by users (i.e., co-exist in the history of multiple users) are close to the vector space. Thus, by calculating the mean vector of the vectors of a user's games we can say that we are vectorizing the user's preference in the space of lottery games. Then, the Euclidean distance of the user's preference with all the vectors of the games s/he did not play is calculated. The game with the shortest distance from the user's preference vector becomes the recommended game for them that is sent through a push notification message.

#### *4.6. A/B Testing Results*

One of our research objectives and a deliverable aim of our project was to test sessionbased recommendations in the real environment of an online shop. For this purpose, we integrated all the SBRS methods that we analyzed in this paper and created a demonstrator to enable evaluations using different recommenders in a real environment and with real users. One target was to measure the effectiveness of SBRS, but we also wanted to consider other practical issues such as efficiency and adaptation to business rules.

We utilized A/B testing to conduct the study. A/B testing is a quantitative evaluation technique that compares two real versions of a web page or a component of a web application in general to examine which version performs better. These variations, known as A, B, etc., are selected randomly to each new user entering the website. Some of them will be directed to the first version, more rest to the second, and so on. Hence, product recommendations are made to each group of users by a different SBRS method. The division of users into groups is performed with a rotation function. Once users connect to any website, a unique alphanumeric is given which identifies the session id of each user. The session id remains the same for each user until they leave the site. So, the user's session id can be fed

into the rotation function and a different recommendation method is selected for the entire session of a user.

Using A/B testing, we were able to test and verify in a real e-shop which recommender method produces more clicks for recommended products, creates more purchases, and so on. Three SBRS methods were applied, specifically, RNN-based, graph-based, and Item2Vec. Additionally, we used an extra "random" algorithm which made suggestions using only the product category that the visitor was currently viewing.

The recommender component was integrated into an e-shop (leather apparel). When a product is viewed, it shows more recommended products to the visitor, aiming to provide them with a better experience. If this aim is realized, then longer user sessions should be expected, more customer satisfaction, hopefully leading to better conversion rates. Web usage data were recorded to enable calculation of several evaluation metrics (All data and statistics of our A/B testing are accessible in this URL: https://fresanalytics.cntcloud.eu/, accessed on 20 February 2023). All methods have been evaluated for their success based on the number of clicks on recommended products.

Figure 6 shows the number of clicks made by users for an equal number of user sessions, using each algorithm for a period of time. Thus, based on the results, the RNN method produced more recommendations (4768 in number) while the Graph DB-Neo4J algorithm was the second most effective method (4451 clicks). The Item2Vec algorithm was the third best performing method. It is also important to note that the clicks produced by the "random" algorithm were almost half those of the other algorithms. From these results, one can easily infer that the three algorithms were more effective than the recommendations that were made solely based on category. In other words, the success of the recommendation engine, regardless of the algorithm used, is far greater than the most widely used practice, which is to recommend products coming from the same category as the current viewed product.

**Figure 6.** Number of clicks produced by each recommender method.

The most important metric that highlights the effectiveness of a recommendation engine not only scientifically but also commercially, however, is the click-through rate, i.e., the number of clicks that the e-shop users did as a proportion of the total item recommended (Figure 7).

However, the findings, as presented in Figure 7 below, are very encouraging as the click-through rate of the proposals that came from the recommendation engine exceeded 3%. The above percentage would be much higher if the panel of recommended products was higher on the product view web page. However, it was not possible to do this based on an agreement made with the company owning the e-shop. Another interesting finding was the significant improvement in terms of the bounce rate which was recorded in the Google Analytics of the e-shop after we installed the recommendation component, showing the success of the recommendation engine. Of course, several parameters have been identified that can be improved and would potentially lead to better results. One further experiment

we intend to perform will test different layouts of the recommended products in order to increase the utility of the recommendation process and ultimately increase session time and user satisfaction.

**Figure 7.** Click-through rate achieved by our recommender method.

#### **5. Conclusions and Future Directions**

Nowadays, many retail sales come from e-commerce web applications. Furthermore, e-commerce exploded during the pandemic, a business trend which is expected to last. Subsequently, the effectiveness of e-commerce solutions has become an important challenge for successful e-businesses. For large e-businesses that have tens of thousands or millions of users making repetitive visits and purchases, conventional recommender systems that rely on user ID and products views information are viable and very effective. However, these conventional systems cannot sufficiently address other widespread scenarios such as:

Smaller e-businesses, in which it is difficult to collect user ID information for privacy and other reasons.

More dynamic shopping environments that need to understand the user's intent and preferences at a certain time point, without being obscured in long-term historical shopping behaviors.

Capture a short temporal preference shift in user buying behavior that is represented only in the intrinsic nature of each specific session.

The scenarios outlined above show the need for SBRS. In other words, in many ecommerce applications and environments, it is necessary to learn user behavior patterns using sessions as the main transaction unit. Having identified the main requirements of SBRS and the main tasks, our work in the FFRES project was driven by the need to investigate, develop and evaluate several methods for SBRS. After many lab experiments using our SBRS methods, but also testing their operation in real e-commerce application, our main conclusions related to the next-item and next-basket recommender tasks are as follows:

Additionally, LSTM approaches exceeded Word2Vec performance, albeit not on the same level as in the next-item task.

These conclusions we believe make it clear that designing a SBRS is a complex problem that has practical constraints. Recommendations must be effective, i.e., propose relevant items but also deliver next-item recommendations as highly as possible in the list of suggestions. At the same time, the operation of a recommender (i.e., data gathering, data curation and modeling, processing, analysis, filtering) should be executed efficiently and in a way that allows operators to frequently update the recommender models. This is one direction that we plan to explore in our future research.

Besides the work we conducted on next-item and next-basket recommendations, we also worked on the purchase intent problem. This study was mainly motivated by the idea that e-commerce applications should have components for continuously monitoring users during their navigation. We believe that the key features such components can deliver into e-commerce applications are proactive stimuli actions, offering buying incentives to the user.

In conclusion, we believe that by completing the FRES project we have demonstrated the importance of SBRS for e-commerce applications. Furthermore, we have developed and tested many methods to effectively execute all the main tasks and predictions of an SBRS: next-item and next-basket recommendations, as well as purchase intent. The most effective method in all these tasks was RNN-LSTM. This method could become the cornerstone for developing more complex frameworks for e-commerce applications that will aim at higher conversion rates and better profitability.

**Author Contributions:** Conceptualization, M.S. and K.D.; methodology, M.S., A.K., T.S., M.D., P.K. and K.D.; software, A.K., T.S., D.T., P.K., K.C. and M.D.; validation, A.K., T.S., P.K., C.B and M.D.; formal analysis, A.K., T.S., K.C., M.D., D.T, P.K.; investigation, M.D. and I.K.; resources, C.B. and K.D.; data curation, M.S., P.K. and D.T.; writing—original draft preparation, M.S. and I.K.; writing—review and editing, M.S and I.K.; visualization, D.T.; supervision, M.S. and K.D.; project administration, K.D.; funding acquisition, K.D and C.B. All authors have read and agreed to the published version of the manuscript.

**Funding:** This research work received funding by the European Regional Development Program of the European Union and also by the Greek state through the Program RESEARCH–CREATE– INNOVATE (project code: T1EDK-01776).

**Informed Consent Statement:** Not applicable.

**Data Availability Statement:** Restrictions apply to the availability of these data. Data was obtained from on leather apparel e-shop and are available from the authors with the permission of the leather apparel e-shop.

**Conflicts of Interest:** The authors declare no conflict of interest.

#### **Notations and Abbreviations**

#### **References**

**Disclaimer/Publisher's Note:** The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

### *Article* **Session-Based Recommendations for e-Commerce with Graph-Based Data Modeling**

**Marina Delianidi, Konstantinos Diamantaras \*, Dimitrios Tektonidis and Michail Salampasis**

Department of Information and Electronic Engineering, International Hellenic University, 57400 Thessaloniki, Greece

**\*** Correspondence<EMAIL_ADDRESS>