Mobile Expert System: Exploring Context-Aware Machine Learning Rules for Personalized Decision-Making in Mobile Applications

: Expert systems, a form of artiﬁcial intelligence (AI), are typically designed to solve many real-world problems by reasoning through knowledge, which is primarily represented as IF–THEN rules , with the information acquired from humans or domain experts. However, to assume such rules for personalized decision-making in an intelligent, context-aware mobile application is a challenging issue. The reason is that different mobile users may behave differently in various day-to-day situations, i.e., not identical, and thus the rules for personalized services must be reﬂected according to their symmetrical or asymmetrical behavioral activities. Therefore, our key focus is to solve this issue through adding personalized decision-making intelligence to develop powerful mobile applications to assist the end-users. To achieve our goal, in this paper, we explore on “ Mobile Expert System ”, where we take into account machine-learning rules as knowledge-base rather than traditional handcrafted static rules. Thus, the concept of a mobile expert system enables the computing and decision-making processes more actionable and intelligent than traditional ones in the domain of mobile analytics and applications. Our experiment section shows that the context-aware machine learning rules discovered from users’ mobile phone data can contribute in building a mobile expert system to solve a particular problem, through making personalized decisions in various context-aware test cases.


Introduction
The smartphone sector has risen tremendously in the mobile phone application industry as a result of recent developments in science and technology [1,2]. Because of their many capabilities, which include data storage and processing, these devices are often regarded as one of the most important Internet-of-Things (IoT) devices [3]. To put it another way, today's smartphones are also known as "next generation multi-functional mobile phones" (i.e., "powerful cell phones" and "wireless-enabled PDAs") since they allow data processing and better wireless connection [4]. We demonstrated in an earlier paper [5], that users' interest in "mobile phones" is increasing at a faster rate than that of other platforms, such as "desktop computers", "laptop computers", and "tablet computers", according to Google Trends data [6] and that this interest is increasing on a daily basis, as illustrated in Figure 1.
There are many real-world applications for smartphones, including emailing, instant messaging, online shopping, web surfing, entertainment, and social media, such as Facebook, LinkedIn, and Twitter, as well as a wide range of Internet of Things (IoT) services, such as smart cities, health, transportation, and many more [3,7]. Due to the execution environment, usage preferences, and flexibility, mobile applications vary from desktop applications in our real-world life [2]. A static execution environment is usually intended for a desktop computer program, whether it is used in the workplace or at home, or in other static locations. However, this static prerequisite does not apply to mobile networks or systems in general. The reason for this is because the environment in which a mobile application operates is always changing, and computing is rapidly moving toward pervasive and ubiquitous environments. As a result, mobile apps that are "context-aware" should be responsive to changing environments and act appropriately based on the context in which they are used [2]. During the present Fourth Industrial Revolution (4IR or Industry 4.0) we are living in, artificial intelligence (AI) techniques are used in many application areas, including smart mobile applications for automation and intelligent computing [8,9]. In the context of smart mobile computing, many applications, such as individualized recommendations or suggestions, virtual assistants, mobile businesses, healthcare facilities, security vulnerabilities, as well as the management of the coronavirus COVID-19 pandemic, have recently been explored based on artificial intelligence-based models and their implementation in practice [2,8,10]. In our previous study, Sarker et al. [2], we looked at these apps and how they interact with AI techniques. The following are some of the features of intelligent applications that assist smartphone users in their everyday tasks. They are action-oriented, context-aware, adaptable, suggestive, and decision-oriented, data-driven, cross-platform operations [2], which are needed to consider while developing an application. In this paper, we focus mainly on decision-making intelligence in a system. Although various machine learning classification techniques [11], as well as deep learning techniques [9] within the area of AI are popular, we explore on expert system modeling using rule-based machine learning method to achieve our goal. The reason is that the rules are capable of representing the relevant knowledge in a very clear and efficient way and easily understandable by human experts. Moreover, the model can be improved or updated by adding, deleting, or modifying rules according to the needs, which makes the system more flexible rather than a traditional black-box model.
Expert systems, a form of artificial intelligence (AI), are typically designed to solve many real-world problems by reasoning through knowledge, which is primarily represented as IF-THEN rules, with the information acquired from humans or domain experts. Thus, the goal of an expert system is to translate information from a human expert into a set of hardcoded rules that can be applied to the input data for making intelligent decisions. Although it may be considered that a rules-based system has "fixed" intelligence, we take into account machine learning rules for personalized decision-making in an intelligent context-aware mobile application. As in the real world, mobile users' behaviors are not identical, different users may behave differently in various day-to-day situations. For instance, one user may want to read the news when she or he is in a happy mood on a holiday morning, while another user may prefer to use Facebook. Thus, the rules for personalized services must be different according to their behavioral activities and preferences, which may vary from user-to-user in various contexts, such as temporal, spatial, social, environmental, etc. Therefore the key question is "how we can design an effective knowledge-base containing contextual information to build an expert system that can add personalized decision-making intelligence?" To answer this question, in this paper, we introduce "Mobile Expert System", where we take into account machine-learning rules as knowledge-base rather than traditional handcrafted static rules. Thus, the concept of a mobile expert system enables the computing and decision-making processes more actionable and intelligent than traditional ones in the domain of mobile analytics and applications.
The key contributions of this work can be summarized as follows: • To make personalized decisions, we take into account machine learning IF-THEN rules rather than human-generated hand-crafted rules; • We design a mobile expert system modeling framework, where the automated IF-THEN rules generated by machine learning methods, are used as knowledge-base of the system, to build powerful mobile applications according to today's needs; • We use real mobile phone datasets to extract relevant rules based on multi-dimensional contexts and show how these rules may generate personalized decisions in a variety of context-aware test situations.
The remainder of the paper is structured as follows. In Section 2, we provide a background of our study in the area of context-aware mobile systems. In Section 3, we present our machine learning rule-based expert system modeling for making personalized decisions. Experimental results with extracted machine learning rules are presented and discussed in Section 4. Finally, Section 5 concludes this paper highlighting future work.

Background and Related Work
In most cases, research that relies on mobile data collected from a variety of sources is application-specific, with results varying from one app to the next. Many applications are becoming increasingly popular in the field of mobile analytics and apps, including smart context-aware mobile communication, intelligent mobile notification management, contextaware mobile recommendation, and so on. Smart context-aware mobile communication is one of the most interesting and well-researched applications (e.g., intelligent phone call interruption management) [12][13][14][15][16][17]. Several studies have been performed on mobile notification management [18][19][20][21]. Similarly, a number of experiments on the recommendation method have been carried out [22][23][24][25][26][27].
Hong et al. [28] proposed a context-aware approach for delivering customized services that is based on a decision tree classifier. Lee et al. [29] proposed a decision tree-based approach for providing mobile services to cell phone users, which they believe would be beneficial to them. Zulkernain et al. [12] developed an intelligent mobile interruption management system to help mobile phone users in their everyday activities. In [30], Sarker et al. presented a machine learning-based user behavior model based on contextual smartphone data that was based on contextual smartphone data. In addition to these methods, Pejovic developed a model to manage mobile interruptions [7]. Classification techniques, such as AdaBoost and naive Bayes, were utilized in the development of their model. Pielot et al. [13] developed a model that predicts the availability of phone calls in advance. In another research, Pielot et al. [31] used a range of classifiers, including naive Bayes, logistic regression, support vector machines, random decision trees, and random forests. However, classification-based prediction models may not always provide high predictive accuracy in user behavior modeling in a variety of scenarios, since there may be an over-fitting problem owing to a lack of generalization in the classification-based predictions [19,32].
Although, in the field of mobile analytics and applications, various methods are used, in this work we concentrate primarily on the rule-based machine learning method that can extract rules from data and behave accordingly. The reason is that the rules in the professional frameworks are easily comprehensible to humans and are capable of representing the relevant knowledge in a very clear and efficient way. Moreover, by adding, deleting, or modifying rules based on the information of domain experts or recency, i.e., based on recent trends [33], rule-based models can be easily improved according to the needs.
Association rule mining (ARM) [34] techniques are well established in terms of the reliability and versatility of the rule as [32] has its parameters, such as support and confidence. Market basket analysis, IoT services, medical diagnostics, analytics of user behaviors, web analytics, and other application domains, as well as mobile analytics and applications, all use association rules. Mehrotra et al. [19], for example, proposed a method for determining individual expectations for intelligent mobile notification management systems. In their technique, they use the association rule mining algorithm AIS [35] to automatically extract rules. The association rule mining technique is used by Srinivasan et al. [36], to mine user behavioral rules based on contexts utilizing individual phone log data. Zhu et al. [27] proposed a method for mining cell phone users' preferences to develop a context-aware recommendation framework based on user choice. To extract user expectations, they frequently use the association rule discovery technique in their process. However, Sarker et al. have shown in [37] that the Apriori rule mining algorithm generates several redundant user behavioral rules based on multi-dimensional contexts, potentially leading to a complex and unproductive decision-making model.
Although association rule mining techniques have the drawback of generating redundant rules, its completeness is the main strength of association rule mining as it produces all associations that meet the user-specified constraints, such as minimum support and confidence value. Such completeness in rule generation can be used to build a strong knowledge base in an expert system modeling, in which we are interested.

Mobile Expert System Modeling: Machine Learning Rule-Based Design
In this section, we discuss how we design mobile expert systems through machine learning rules as "knowledge-base" rather than handcrafted rules or human-generated rules for intelligent personalized services. Thus, in the following, we first discuss the structure of a rule-based mobile expert system, which consists of three primary modules (i) knowledge-base, (ii) inference engine, and (iii) user interface, where the module "knowledge-base" is known as "intelligence engine" consisting of a set of context-aware rules discovered by machine learning method. We then explore how we can generate a set of context-aware rules for the intelligence engine that can make personalized decisions in various context-aware cases of mobile phone users.
As mentioned earlier, in Figure 2, we show a structure of a mobile expert system consisting of three modules discussed below with their roles. • Knowledge-base: In our mobile expert system modeling, this module is known as the "intelligence engine" for personalized decision making in which we are interested.
It thus contains the knowledge of the target mobile application domain, as well as operational knowledge of the decision rules.
Rules are typically structured as IF-THEN statements of the form: where the <Antecedent> contains contextual information, for example, a spatial context: user location → at home; On the other hand <Consequent> represents user behavioral activity class for decision-making, for example, a class: activity → read news.
As we are interested in discovering data-driven automated rules, rather than the handcrafted rules used in a typical expert system, we employ a rule-based machine learning method to generate rules. To extract contextual associations from an individual's mobile usage data, we use the principle of the Apriori association rule learning technique [34] because of its completeness in rule generation. We take into account this completeness to build a strong knowledge-base. As the traditional association rule learning technique produces all the possible associations, and typically used for market basket analysis, we take into account two principles for generating the decision-making rules in our knowledge-based mobile expert system. These are: (i) the consequent represents only the user behavioral activity class rather than the possible combinations considered in typical association rules, and (ii) the non-redundant rules are used as knowledge-base for decision-making, where a rule is called redundant if it contains additional contexts for the same decision-making. For instance, according to Sarker et al. [38] "Let, two rules R 1 : A 1 ⇒ C 1 and R 2 : A 2 ⇒ C 2 , we call the latter one redundant with the former one if A 1 ⊆ A 2 and C 1 = C 2 ".
The overall procedure for generating the context-aware rules is set out in Algorithm 1. Initially, we take the dataset: DS = X 1 , X 2 , ..., X n as input, where each instance X i contains a number of contexts and user behavioral activity class. According to Algorithm 1, a list of candidate itemsets, i.e., contexts, has been generated based on Apriori association rule learning property. Thus, frequent itemsets are selected based on minimum support value, which may differ from user to user according to their daily usage and preferences. At the same time as generating associations, we take into account the user behavioral activity class as a consequent. The reason is that our goal is to generate rules where the contextual information is used as antecedent and user behavioral activity as consequent, according to the rule structure mentioned above. To select the valid decision-making rules, both the confidence preference and non-redundancy are taken into account, as mentioned earlier. The rules are then ranked according to confidence value, which measures the strength of the rules. Finally, this algorithm returns a set of context-aware rules as stored in CAR list .
As users' behavioral activities or preferences are not static in the real world, the extracted rules using Algorithm 1 may vary from user to user. The reason is that this technique directly extracts rules from individual mobile usage data, which makes the system personalized for making intelligent decisions in various context-aware test cases of the users. Thus, the knowledge-base of our expert system modeling is fully automated for making personalized decisions, rather than handcrafted rules used in a typical expert system.

•
Inference engine: The inference engine, which selects rules from the list to execute, is another processing module of the expert system. It seeks knowledge-based information and relationships and offers answers, forecasts, and recommendations the way a human expert might. In other words, the "knowledge-base" discussed earlier is used to conclude circumstances. Therefore, the main task of the inference engine is to find its way to a conclusion through a set of rules, discovered by Algorithm 1.
To complete this, the method of forwarding chaining can be used, starting from the known facts and moving forward by applying rules of inference to obtain further data, and it continues until it reaches the target. Another method of backward chaining that begins from the goal can also be used according to the needs, going backward by using inference rules to decide the facts that match the goal. • User interface: A user interface is a process by which a user is dealt with by the expert framework. This may be by dialogue boxes, prompts for orders, types, or other methods of input. Some advanced systems communicate with other computer programs and do not communicate directly with a human being. The expert system will provide an interaction method for transactions with the other program in these instances and will not have a user interface. Although all the modules knowledge-base, inference engine, and user interface, discussed above can contribute to building a mobile expert system, the module "knowledgebase" is known as "intelligence engine" is responsible for making intelligent decisions according to the extracted rules, generated by Algorithm 1. Thus, the proposed design of knowledge-base using rule-based machine learning method enables the computing process more actionable and intelligent for making personalized decisions of the mobile phone users.

Experimental Results and Discussion
In this section, we discuss the extracted context-aware IF-THEN rules and their effectiveness while making a personalized decision in a mobile expert system modeling. For this, we first discuss users' mobile usage datasets that are used for discovering rules.

Dataset Descriptions
To extract the context-aware IF-THEN rules using rule-based machine learning techniques, we have conducted experiments on two different contextual datasets. One is the "phone call dataset" of mobile phone users with different types of calls, e.g., incoming call responses, such as answering or rejecting calls, missed and outgoing user calls [39]. The contextual information includes temporal, spatial, and social relationships. To generate rules from the phone call datasets, we have used our earlier behavior-oriented time segmentation (BOTS) technique [40] to pre-process the raw time-series data to create dynamic time segments with similar behavioral patterns. We also generate data-centric social contexts [41] from the raw data for our experimental purpose. Another one is "smartphone apps usage dataset" [42] containing various types of apps usage activities, e.g., using Gmail, Facebook, YouTube, Whatsapp, Browser, Google Maps, etc., in several contexts, such as temporal context, work status, spatial context, their emotional state, Internet connectivity, or device-related status.

IF-THEN Decision-Making Rules for Knowledge-Base
In this experiment, we first discover the context-aware IF-THEN rules from the phone call dataset mentioned above using the rule-based machine learning method used in our expert system modeling. In Table 1, we have shown a set of the sample generated IF-THEN decision-making rules considering the temporal context, spatial context, and social relationship, according to the availability in the data, mentioned above. Similarly, in Table 2, we have shown another set of generated IF-THEN decisionmaking rules based on app use contextual data, in which greater number contexts are included in the data. As we develop these criteria for a particular confidence choice, the results are shown in Tables 1 and 2, where the desired confidence level is, for example, 80%. Because no two people behave in exactly the same way in the actual world, this confidence preference may vary from user to user according to their preferences, and as a result, the knowledge-base may need to be updated in order to make personalized choices.

Effectiveness Analysis
If we look at Tables 1 and 2, we can see that the antecedent part (IF) of the rules reflects users' contextual knowledge, and the consequent part (THEN) represents their associated behavioral actions, with their corresponding confidence values that assess the strength of the rules. For instance, the rule R 4 in Table 1 states that the user rejects most of the incoming calls (92%) from Relationship1 on Sunday, when she is at Parkslope. Similarly, the rule R 4 in Table 2 states that the user watches a movie at home (88%), when she is in sadmood and WiFiconnectivity is on.
According to the rules generated in Tables 1 and 2, we can say that the number of contexts in the rules is not static, may vary while generating rules, depending on the associated contextual patterns. For some rules, only a few numbers of contexts or even one context, e.g., rule R 5 with the only temporal context in Table 1, can make the decisions with a high confidence value, and, in some cases, the rules consist of higher dimensions of contexts, e.g., rule R 5 consists of temporal, workday status, spatial, Internet connectivity, and user mood in Table 2. Thus, it is difficult for human experts to assume such dynamism in context-aware rules to make the expected decisions according to personalized preferences. Moreover, the preferences in association rules may vary from user to user in real-world life and diverse situations. The machine learning association rules that are taken into account in our discussion are capable to handle such dynamism according to the data patterns, which can effectively make the decisions based on the associated contexts.
Because confidence is correlated with accuracy level, the produced rules are more trustworthy when it comes to making decisions based on the preferences of the users. Increased accuracy is represented by a greater confidence level; nevertheless, it produces a small number of rules, as a result of which it lacks rules in the knowledge-base and vice versa. By default, we utilize a 80% confidence preference to extract the decision rules, taking into account an accuracy level of 80% for all users. We also provide customers with the ability to customize this accuracy level depending on their particular preferences while taking into account the trade-off between confidence level and the information in the knowledge base. Consequently, the behavior-oriented rules of mobile phone users with the confidence values given in Tables 1 and 2 and those produced from mobile phone data may be utilized to improve the effectiveness of the mobile expert system.

Conclusions and Future Work
In this paper, we have discussed the context-aware rule-based expert system modeling for mobile applications to make intelligent decisions. The rule-based expert system is considered one of the key artificial intelligence techniques that can be used to make intelligent and more powerful applications in the area. Our analysis of context-aware rule-based expert system modeling can play a significant role in designing and building data-driven intelligent mobile systems. The rule-based expert systems can provide various smartphone services including personalized, eHealth, business, smart cities, IoT, and many more to the users. Such systems, either stand-alone or distributed, may assist the users intelligently according to the generated rules in different contextual day-to-day situations in their daily life. In the domain of smartphone applications, the concept of a mobile expert system enables for making computing processes more actionable and intelligent than traditional ones. Overall, we believe that the notion of machine learning rule-based expert system modeling will benefit both researchers and application developers, especially when it comes to providing data-driven personalized services.
In the future, we plan to develop a real-life mobile application using the extracted machine learning rules as a knowledge-base, to measure the effectiveness at the application level.
Author Contributions: I.H.S., A.I.K., Y.B.A. and F.A.; conceptualization, methodology, software, validation, formal analysis, investigation, resources, data curation, writing-original draft preparation, writing-review and editing, visualization, supervision, project administration, funding acquisition. All the authors contributed equally. All authors have read and agreed to the published version of the manuscript.