Stock market prediction using weighted inter-transaction class association rule mining and evolutionary algorithm

Abstract Evolutionary computation and data mining are two fascinating fields that have attracted many researchers. This paper proposes a new rule mining method, named genetic network programming (GNP), to solve the prediction problem using the evolutionary algorithm. Compared with the conventional association rule methods that do not consider the weight factor, the proposed algorithm provides many advantages in financial prediction, since it can discover relationships among the attributes of different transactions. Experimental results on data from the New York Exchange Market show that the new method outperforms other conventional models in terms of both accuracy and profitability, and the proposed method can establish more important and accurate rules than the conventional methods. The results confirmed the effectiveness of the proposed data mining method in financial prediction.


Introduction
Stock market prediction has always been an intriguing issue in research and a great challenge because of the complex and volatile nature of the problem. Because the accurate prediction of stock movement may attract large profits in trading, many technologies have been applied to this field. Existing techniques for stock market prediction can be separated into three categories: fundamental analysis, technical analysis, and technological methods. Technological methods rely on the use of mathematical models and computer techniques to search for the optimal investment strategy through simulations. Artificial neural networks, genetic algorithms, genetic programming, support vector machines, and data mining are the most common methods used for these predictions (Chandar, 2021;Chen et al., 2021;Ding et al., 2020;Kim & Sohn, 2010;Sermpinis et al., 2013;Trippi & Turban, 1992;Wong et al., 2010;Yang et al., 2002). However, most of these methods focus on the stock price, disregarding a large amount of useful information that exists among different stocks. In an attempt to overcome this problem, the weighted intertransaction class association rule (WICAR) is proposed in this paper to represent the relationships among attributes from different transactions, which has proven to be quite useful in terms of stock market prediction.
In the era of big data, it is imperative to extract effective information from massive amounts of data, and to explore the underlying rules between various structured data and unstructured data, so as to better serve forecasting and decision-making. As one of the optimization algorithms in the field of machine learning, evolutionary computing has shown clear advantages in previous research and practice. Therefore, this study further explores the application of evolutionary computing in the financial field. In this research, WICAR and GNP are used to predict the movement of stock prices to make an investment decision accordingly. The paper contributes to the computing and finance literature in several ways. First, a rule mining algorithm based on GNP is designed to find the inter-transaction association rules, which are regarded as an approximate solution. In comparison with the Apriori algorithm, which is an accurate approach, the approximate solution is more suitable for a large-scale database. Second, the concept of weights is used to identify the rules that are more important or reliable. As the importance of each association rule is different, more effective rules can be determined by considering the weights. Third, the relationship between the trading volume and stock prices utilized in weighted association rule mining is combined with the basic idea of deciding the weight according to the variation in the trading volume. In particular, a novel contribution of the WICAR method is that it is a dynamic weighting algorithm. This is of special importance because in time series data, the weight of each transaction item cannot be fixed. It should be emphasized that the proposed evolutionary-based method can be used not only in the financial market, but also in many other fields, such as for an elevator group supervisory control system, a bidding strategy consisting of multiple rounds in an English auction, an intrusion detection system for the internet, and a traffic prediction system. The remainder of this paper is organized as follows. In Sec. 2, background information and a literature review are provided. In Sec. 3, the structure of the model is described. In Sec. 4, the weighted association rule mining method based on a GNP structure is explained. In Sec. 5, the experimental environment, conditions, and results are presented. Finally, Sec. 6 concludes the paper.

Literature review
In recent decades, data mining has been a powerful new technology in the field of artificial intelligence with great potential to focus on the most important information in the data. Data mining can be considered as an ingredient of knowledge discovery in database (KDD), which has attracted the interest of many researchers. Several data mining methods, such as classification methods, association rules mining, and cluster analysis have been proposed and widely used in various fields (Cassioli et al., 2013;Cheng & Cheng, 2019;Corne et al., 2012;De Angelis & Dias, 2014;Han & Kamber, 2006;Kanungsukkasem & Leelanupab, 2019;Wang et al., 2012Wang et al., , 2017Wang et al., , 2019. In the field of data mining, association rules mining is a useful method for discovering the interesting relationships hidden within a large-scale database. Association rules mining was proposed in the early 1990s (Agrawal et al., 1993). The basic idea of this method is to identify items that frequently appear concurrently. These frequent item sets, which comprise an antecedent part (X) and a consequent part (Y), can be considered as rules or patterns (X ! Y). A well-known algorithm for mining the association rules is the Apriori algorithm (Agrawal & Srikant, 1994). This algorithm provides accurate results by resorting to the support-confidence framework to identify frequent item sets that exceed the given minimum support and confidence threshold. More specifically, the Apriori algorithm is an algorithm that finds frequent itemsets and generates association rules based on them. Its essence is an iterative method of layer-by-layer search, and each search is divided into two stages: generating candidate sets and testing support. This algorithm is easy to understand and easy to implement, and is one of the classic algorithms in the field of data mining. Subsequently, many other algorithms have been proposed with the aim of increasing the efficiency of the association rules. Four methods are usually used to reduce the computational cost: reducing the number of passes through the database (Agarwal et al., 2001;Yuan & Huang, 2005), sampling the database (Chuang et al., 2005;Li & Gopalan, 2005), adding additional constraints to the structure of patterns (Manning & Keane, 2001;Parthasarathy et al., 2001), or using parallelization (Do et al., 2003;Gebali et al., 2019;Hou et al., 2018;Wojciechowski & Zakrzewicz, 2002).
In addition to association rules which provide accurate solutions, heuristics and genetic solutions have also been proposed for large-scale databases. Ashish and Bhabesh used a Pareto-based genetic algorithm to extract useful and interesting rules (Ghosh & Nath, 2004). Ishida et al. used the greedy randomized adaptive search procedure with path-relinking to recreate rules (Ishida et al., 2009). Shimada and Hirasawa developed mining methods based on genetic network programming (Shimada et al., 2006). The advantages of these delicately designed algorithms are that they are less time-consuming and yield stronger relationship rules. In the analysis of the association rules, favorite measurements of interest are support and confidence. Other measurements have also been studied in relation to association rules (Chan, 2020;Chen et al., 2008;Chen & Shi, 2016;Geng & Hamilton, 2006;Jaggi et al., 2021;Lenca et al., 2008;Long et al., 2020;Menaga & Saravanan, 2021;Su et al., 2019;Sun & Meinl, 2012).
The basic principle of the association rules has been extended to develop more advanced rules, such as, inter-transaction association rule mining, which is an extension of classical association rule mining (Hongjun & Ling, 2000;Tung et al., 2003). This new method is fundamentally different from the initial method because it considers the association rules between different transactions, thus facilitating the application of these rules to the prediction problem. These inter-transaction association rules have been used to predict stock movement (Lu et al., 1998). Yang et al. applied GNP to the inter-transaction association rule mining method to determine the operation strategy in the stock market. Both binary and fuzzy implementations of the method have been introduced (Yang et al., 2011a(Yang et al., , 2011b. Although prediction of the stock market aims for high accuracy as well as large profits, researchers mostly focus on the profitability rather than accuracy. However, Yang et al. strived to balance accuracy and profitability, and finally obtained an optimized strategy. Classical association rule mining does not consider the importance of different rules. Even though different items affect profitability differently, the classical association rule mining method treats all rules equally. Thus, the weighted association rule was proposed to address this shortcoming. The weighted association rule mining method allocates higher weights to the rules that are more interesting to the researchers. In studies of weighted association rule mining, different algorithms have been proposed with different understandings of the 'weight' concept. For instance, Wang et al. considered the numerical attributes of an item (Wang et al., 2000). They pointed out that, even though the transactions contain the same items, they are actually different because of the numerical attributes. Another viewpoint of the weighted association rule problem is that different rules are of differing importance to researchers (Tao et al., 2003). Although certain rules have lower criteria of support or confidence, they may be more valuable than those with higher criteria. A weighting method for association rules without pre-assigning weights was also proposed (Sun & Bai, 2008). The method differs from previous ones in that the author introduced wsupport under the assumption that good transactions consist of good items. Based on this idea, the weights do not have to be assigned initially.
In addition to the rules discussed above, association rules are very popular and have been applied to marketing, finance, medical sciences, etc. In marketing, mining with the aid of association rules is often used to identify patterns among shopping items, or the relationship/preference between customers and items. The association rule mining method was used to discover the online shopping patterns across websites (Yang et al., 2013). An advertising algorithm was developed to choose potential customers for new products based on the association rules (Hwang & Yang, 2008). In the financial field, mining based on association rules is often used for credit card analysis, such as detecting the fraudulent use of these cards (S anchez et al., 2009;Song et al., 2021;Yao, Cai, and Wang, 2021).
The focus of this study is genetic network programming (GNP), which plays a key role in the proposed algorithm. GNP can be considered a natural extension of the genetic algorithm (GA) and genetic programming (GP), and it uses an iterative process to reach the optimal solution. GNP was proposed to solve more complicated problems, and it has already been identified as an effective method for solving dynamic problems (Mabu et al., 2007). In particular, GNP was employed in the estimation of distribution algorithms to predict traffic conditions (Li et al., 2010). GNP was also used to solve the problem presented by the elevator group supervisory control system . Additional details of GNP are provided in Sec. 3.
In capital markets, the trading volume is the number of shares or contracts traded in the security market during a given period of time. This information is important for investors in predicting the movement of stocks. Many studies have focused on the relationship between trading volumes and stock prices. Studies show that volume fluctuations are accompanied by the appearance of new information. The different views of investors, the different expectations for the price of a stock can lead to a great exchange among shareholders. The relationship between volumes and prices has already been examined by a statistical method (Ying, 1966), the main conclusions of which were subsequently summarized (Sun, 2003), and can be listed as follows: A small volume is usually accompanied by a fall in price. A large volume is usually accompanied by a rise in price. A large increase in volume is usually accompanied by a large price change. A decrease/increase in the volume for five straight trading days is expected to cause the price to fall/rise over the next four trading days.
Other views also exist in the literature. Certain scholars consider the volume to be positively correlated with an absolute price change (Karpoff, 1987), whereas others consider the trading volume to be heavy during a bull market, but light during a bear market (Epps, 1975(Epps, , 1977. Previous research on association rule mining did not consider the impact of the trading volume on stock movement. This has prompted the current study, which uses the relationship between these two factors, to improve the association rule mining method.

GNP structure
Genetic network programming, GNP, has a graph structure which consists of three types of nodes: a start node, judgment nodes, and processing nodes, as displayed in Figure 1(a). These three types of nodes connect to each other with directions. A connection is randomly generated during the initialization of GNP individuals. The start node is the starting point of an individual. The judgment nodes operate as IF-THEN type logical functions to determine the next node depending on the current information, and these nodes form a set J 1 , J 2 , … , J m . The processing nodes are used to execute decisions and are denoted by P 1 , P 2 , … , P n . These decisions are buying and selling actions, which are determined by thresholds and the values of the variables.
The gene structure of one GNP node is displayed in Figure 1(b). Each node has two segments: the node gene and connection gene. The node gene indicates the node type, node ID, and time delays. The connection gene indicates the connections to other nodes. The node gene K i indicates the type of node i, where 0 represents the starting node, 1 the judgment node, and 2 the processing node. The ID i is the identification of the node and d i signifies the time delays. In this study, time delay is defined as the width of a sliding window used to determine the inter-transaction association rules. The connection gene defines the connection of node i to other judgment and processing nodes. For example, C i1 refers to the node in the first branch of node i, and d i1 indicates the time delay from node i to the node in the first branch of node i. Based on this structure, GNP employs genetic operators of selection, i.e., crossover and mutation, which are the same in a genetic algorithm.

Data structure
The data structure determines the mining method. In this research, two basic databases were used for association rule mining. The first is the transactional database, the rows of which contain the transaction records. The second is the weight database, which contains the weights of each transaction. In Table 1, the columns are the attributes denoted as A 1 , A 2 and A 3 , which are part of the transaction captured from the transaction database.
Application of the association rule to discrete data requires that the transaction data be discretized, to obtain the database presented in Table 2. If the attribute value is larger than zero, the discrete result is (1,0,0). If the attribute value is equal to zero, the discrete result is (0,1,0), and if the attribute value is less than zero, the discrete result is (0,0,1). After this discretized transaction, the number of attributes in the previous database is multiplied by 3 for the new attributes in the transaction database. In this example, the three attributes become nine attributes after discretization, which means that the attributes of A 1 , A 2 , A 3 become A The class data in the consequent part of the association rules include the class information, as listed in the rightmost column of Table 2 and denoted by the variable C. In this research, C pertains to stock prediction and represents the stock movement to predict for the next day. The class data are discretized into three categories, i.e., the Up, Stay, and Down categories, which are indicated by 0, 1, and 2, respectively. If the original class data are larger than zero, they are coded as 2. If the class data are equal to zero, they are coded as 1, and if they are less than zero, they are coded as 0. Table 3 is an example of the weight database of the transaction. The fact that the weight database resembles the transaction database is easily recognized. The attribute value of each transaction has a weight value associated with it, but the class data are not assigned weights. This is the difference between the data structures of the transactional and weight databases.

Weighted inter-transaction class association rule
As mentioned in the literature, the weighted association rule is an improvement over the classical association rule used for mining. The weighted association rule prioritizes the rules by way of weights to modify the results obtained with association rule mining. The main objective of this method is to use the weight of each item/attribute to recalculate the criteria of the association rule.

Definitions in the weighted association rule
Weight of Item In the database discussed above, an attribute in a transaction is known as an item 1 , which is the minimum unit in the database. An item can be considered as a Source: calculated by authors via R software.
product purchased during shopping. In the prediction of stock movement, an item is the variation of stock prices, whereas the weight of the item is the importance of the item. Most of the time, the weight needs to be decided by researchers before the mining process starts. Weight of Itemset. The itemset is the combination of items. The weight of the itemset is the average weight of the items in the itemset and is calculated by the following formula: where n is the number of items in itemset k. The combination of all the itemsets forms the universal itemset. Weight of Transaction. A transaction can be thought of as a subset of the universal itemset. In other words, a transaction is an itemset extracted from the universe. Therefore, the method used to calculate the weight of a transaction is the same as that used to obtain the weight of an itemset. The weight of the transaction can be calculated as follows: where weightðitemðkÞÞ is the weight of item k, and m is the number of items in transaction t i . Therefore, the weight of a transaction can be thought of as representing the average value of the stocks in the transaction. Weighted Support.
The support value is one of the most popular measures in association rule theory. It indicates the frequency of the transaction in the entire database, with a larger frequency indicating a more useful transaction. After the weight has been determined, the support can be modified by the weight. In classical association rule mining, the association rule is supposed to be A ) B, where A and B are itemsets. The extent to which this association rule is supported is the proportion of transactions that contain A and B at the same time. That is where t is the transaction, and I(t) is an indicator function, i.e.,  (4) Each time A and B appear in one transaction, the numerator adds one. Therefore, the weight of each item is the same as in conventional methods. Introduction of the weight into the support function modifies the function as follows.
where weight(t) is the weight of transaction t, and n is the number of transactions. This modified support function considers the weight of the transactions, which means that for each transaction the weight of the transaction is added to the numerator. Therefore, transactions with more weight are assigned higher support criteria even if they appear infrequently.
The weighted confidence can be modified in the same way as the support. The confidence measures the probability of itemset B when itemset A appears.
The fact that the numerator does not represent support can easily be demonstrated, while the denominator is the probability that itemset A appears. Therefore, the weighted confidence can be modified as follows: where wsp represents the weighted support and I 0 ðtÞ is an indicator function, i.e.,

Dynamic weights of the association rule
In general, determining the weight of each item is a difficult task for at least two reasons. First, the database usually contains hundreds of items, and it is impossible to allocate weights to each itemset. Second, the weight of an itemset is also difficult to decide. Manual allocation, usually makes this a challenging task, especially when the database contains hundreds of items, the task becomes manually insurmountable. A method was proposed to find association rules without pre-assigned weights Sun and Bai (2008), taking into consideration the quality of the transactions using linkedbased models.
In this research, a new method was proposed to allocate weights to the items in association rule mining. Existing weighting methods enhance the effects of items that are important, and lessen the effects of those that are unimportant. This means that the relationship between the items and the target variable has to be determined. For example, in the supermarket, the sales profit is strongly related to the sales volume of products. Thus, the regression of the profits on the variables representing the sales volume can be expressed as: The coefficient of each item is the profit the item contributes or consumes when it increases or decreases by a unit. Therefore, the coefficient can be used as the weight of this item, because the coefficient reflects the importance of the item with respect to the profit, as expressed by the following function: The weights of the itemset in a transaction can be calculated based on 2, introduced in Sec. 3.3.1.
In certain cases, it is not easy to derive this relationship using regression methods. For example, when predicting stock movement, the objective is to predict the prices of certain specific stocks, and the items in the antecedent are other stocks. The relationship between the target stock and the stocks in the antecedent cannot be determined by a simple regression model. This problem could be solved by finding another variable that has a certain relationship with the target variable and using it as a dummy variable to augment the original one.
Conventional methods assign weights by requiring that the weight of each item be fixed. However, if a dummy variable is used as the weight of an item, the weight does not necessarily always have to be the same. This is referred to as dynamic weighting. For example, because there is a relationship between the stock price movement and the trading volume, and the volume is positively correlated with the absolute price changes, dynamic weighting can provide guidance in determining the weight of the items. In attempting to solve the prediction problem, certain results of previous studies were found to be useful in the discussion on variables or factors having a relationship to stock price movements (Sun, 2003). The author summarized the relationship between the trading volume and stock price as 'A large increase in volume is usually accompanied by a large price change'. Thus, in the proposed method, the volume fluctuation is used as the weight for the association rule.
Here, the database structure is revisited because the structure determines the weighting method. In the stock price and trading volume database, one row of the database contains the changes in the stock price and the daily trading volumes. Therefore, the approach here is to apply association rule mining to the prediction, and then to use the changes in the stock prices of earlier transactions to predict the stock price changes for the next few days. If the trading volumes are used as the weights, the weights would be different in transactions on different trading days, provided the assumption that trading volumes can be used as weights is correct. Thus, the function of support in weighted association rule mining can be modified as follows: Weight of Item. The weight of an item in different transactions can be denoted as weightðitemðk, iÞÞ, which indicates the weight of item k in transaction i. Therefore, the difference from the conventional weight is that weightðitemðk, iÞÞ introduces the dimension of a transaction. Weight of Itemset. The weight of an itemset is modified similar to the weight of an item, in that, the dimension of the transaction is introduced.
weightðitemsetðk, iÞÞ ¼ P nðkÞ j¼1 weightðitemðj, iÞÞ nðkÞ : The weight of itemset k in transaction i, which is the average value of the weights of all items in itemset k in transaction i, and n(k), the number of items in itemset k, are calculated. Dynamic Weighted Support of Association Rule Introducing the dimension of a transaction enables the calculation of the dynamic weighted support of the association rules. In dynamic methods, the dimension does not need to modify the function of support. This is the same for the support function of the weighted association rules because the weight of the itemset already reflects the dimension of the transaction.

Rule extraction and criteria calculation
The key aspects of the method extracting the association rule with GNP are the judgment node chain (JNC) and sliding windows ( Figure 2). The JNC consists of a series of connected judgment nodes, and the processing nodes are used to select the judgment node to start each association rule. As shown in Figure 2, a JNC has two types of connections: yes-side and no-side. A single JNC is limited in terms of the number of judgment nodes it may contain, which limits the depth of rule in a row. In Figure  2, the maximum number of judgment nodes is n. Similar to other evolutionary algorithms, selection, crossover, and mutation are used for the genetic operators of GNP in association rule mining. The evolution process can be outlined as follows: 1. Initialize a randomly generated population. 2. Evaluate the fitness of individuals in the population using a fitness function. 3. Generate new individuals for the next generation by tournament selection and the genetic operations of crossover and mutation. 4. Replace the current population by the new population. 5. If the termination condition is satisfied, then stop; else, go to step (2).
Each JNC represents a transaction, and the judgment nodes are used to determine the attribute that reflects the change of stock prices in the prediction problem. For example, attribute 1 (A 1 ) denotes the price movement direction of stock 1 in one day, and attribute 2 (A 2 ) represents that of stock 2 on the same day. To obtain the intertransaction association rule, another concept, namely that of a sliding window, is introduced. Because several JNCs are combined to present a multi-transaction, the width of the sliding window is the number of combined JNCs. When the window is sliding downwards, a new JNC can be used for association rule mining.
When the judgment node satisfies the condition, the yes-side connection is selected before proceeding to the next judgment node in the same node chain. In the stock prediction problem, the judgment function in the judgment node determines whether the attribute equals 1 or 0. If the condition is not satisfied, the no-side connection is chosen and the function proceeds to the next processing node, which points to the new start judgment node in the next node chain, i.e., the transaction of the following day. Once the search process has been completed, the candidate rule is obtained as follows: A 0 1 ðupÞ \ A 1 2 ðdownÞ \ ::: \ A w m ðupÞ ) CðupÞ The subscript and superscript of the attribute indicate the attribute number and the number of days after the starting day, respectively. Therefore, 12 means that when stock 1 increases on day 0 and stock 2 increases on day 1, … , and stock m increases on day w, it can be predicted that stock C will increase on the next day under the criteria of support and confidence. When the last JNC has been checked, the window slides downward to the next transaction and the same procedure are repeated to determine the next set of candidate rules.
The method for association rule mining is also examined with respect to the database structure. Figure 3 shows a section of the database containing the stock price movements, which also constitutes the sliding window used to search for the candidate rules. The width of the window is 5, with the first four transactions being for the antecedent part of the association rules, and the last transaction for the consequent part of these rules. For example, in Figure 3, after checking that the value of the last attribute is 0, which does not satisfy the condition, the next processing node is selected to proceed to the next transaction.
The example displayed in Figure 3 illustrates the methods used in determining a candidate association rule by GNP. The search process starts from the first attribute (A 0 1 ðUpÞ). Because the value of the attribute is 1, the search moves to the next judgment node in JNC, and the value of the second attribute (A 0 2 ðDownÞ) in the current transaction is also found to be 1. Then, the search moves to the next attribute in the same transaction. Because the value of the third attribute (A 0 3 ðStayÞ) is 0, the search process in the current transaction is terminated. As suggested by the processing node, attribute 3 in the second transaction (A 2 3 ðDownÞ) is selected. The value of A 2 3 ðDownÞ is 1, and the search continues with the second transaction. This process continues until the last transaction in the sliding window is completed. The class attribute in the last transaction, that is, the target stock movement in the prediction problem, along with the combination of attributes searched before, establish the following candidate association rule: A 0 1 ðupÞ \ A 1 2 ðdownÞ \ ::: \ A w m ðupÞ ) CðupÞ: Then, the sliding window moves downwards by one transaction and restarts the search process, after which the search steps are executed the same way as before. After all the processing nodes have been exhausted, the search process is terminated in this sliding window. Then, the sliding window moves downwards to cover the next transaction, as shown in Figure 3. The search process is executed again in the new sliding window. Because the GNP structure is generated randomly at the beginning, the path from one attribute to another is already set when the GNP is formulated. A large number of GNP individuals and genetic operators guarantee that sufficient association rules are found by using this method. The mined association rule r is stored in the rule pool (RP k ) according to the class of the consequent part of the rule.
During the search process, a counter is used to record the number of items and transactions to calculate the weighted criteria of support and confidence. Because each judgment node has a weight, as shown in Figure 2, the weights are added to the counter each time the judgment node is visited. The counters are described as follows: Suppose association rule r is A ) CðkÞ, where Ante½A 1 ½A 2 . . . ½A m is the sum of weights in the antecedent part of the rule and A i ði 2 f1, 2, . . . mgÞ are the items in the antecedent part (A) of association rule (A ) CðkÞ). AC k ½A 1 ½A 2 . . . ½A n ¼ AC k ½A 1 ½A 2 . . . ½A n þ 1 n P n i¼1 weightðA i Þ, where AC k ½A 1 ½A 2 . . . ½A n is the sum of the weights of class k in rule r.
The use of these counters enables the calculation of the weighted support (wsp) and the weighted confidence (wconf) criteria as follows: where Ante½0½0 . . . ½0 is the total number of sliding windows in the database; S max ðrÞ is the maximum interval span over all the attributes in rule r; and S max ðrÞ is used to revise the support in the inter-transaction association rule mining because is not the total number of transactions. Another criterion, v 2 , is introduced to measure the dependency between the antecedent and consequent in the association rule (A ) B). The definition of v 2 is as follows: where N 0 is the revised number of total transactions, and N is the total number of transactions.
where t(X) is the number of transactions that contain itemset X.

Fitness function and genetic operators
The above-mentioned association rule extraction methods can be used to obtain the candidate rules. However, this is insufficient, because the GNP structure, which is initially formulated randomly, only represents part of the rule space. Based on the fitness function and genetic operators, more effective rules can be obtained. The fitness function is designed as: fv 2 ðrÞ þ 10ðn ante ðrÞ À 1Þ þ a new ðrÞg: where v 2 ðrÞ represents the strength of the relationship between the antecedent and consequent in rule r; n ante ðrÞ represents the number of items in the antecedent part of rule r; and a new ðrÞ represents the bonus for new rule r. This fitness function indicates that rules with a higher relationship between the antecedent and consequent, or with more antecedent attributes, attain a higher fitness value. In genetic operations, the rules that are selected should be retained and reproduced to form a new generation. Upon completion of the crossover and mutation operations, the GNP population of the next generation is generated. The definitions of the crossover and mutation operations are given below.
Crossover: the parent individuals exchange their nodes and connections to form new individuals. Mutation: the parent individual changes the functions and connections of the nodes to change the structure of GNP and form a new individual.

Classifier model
Usually, association rule mining can generate thousands of rules and stores them in rule pools. For example, if there are m classes in the consequent part of the rules, m rule pools can be set up to classify the rules as Pool(i) The next part of the work is conducted to answer two questions: How should these rules be used? When new data d are provided, which rules are supposed to match? Two classifiers are used to solve these problems: the complete matching classifier and the partial matching classifier. These classifiers differ in that the partial matching classifier considers the effect of time, which means that the partial method assumes that the latest data have priority over the earlier data.
First, the complete matching classifier is introduced: 1. To measure the way in which data d match rule r in each rule pool (RP k ), S k ðd, rÞ is used as a score for each rule r in class k.
where w(r) is the weight of rule r, which can be the confidence, chi-squared value, or Laplace accuracy. D k ðd, rÞ is the matching degree of rule r in class k with data d. In the complete matching classifier, D k ðd, rÞ ¼ 1 if d matches the antecedent of rule r completely, otherwise D k ðd, rÞ ¼ 0: 2. After obtaining the score of data d, S k ðd, rÞ, for each rule r, the average matching degree m k ðdÞ is calculated in each rule pool RP k by where k ¼ 1, 2, . . . , c and jRP k j is the number of rules in rule pool RP k .
3. Then, the largest average matching degree m k ðdÞ is selected from the rule pool. Class k of this rule pool RP k is the class to which the current data belongs.
As mentioned before, the partial classifier is modified according to the time of data. Therefore, only the first step needs to be modified in the complete matching classifier. The matching degree is modified in the following way: where aðAÞ is used to discount attribute A according to the time period, which has the form of v jojÀ1 (v 2 ð0, 1, and joj is the relative domain address of the class attribute from A). D k ðd, rÞ is the matching degree of rule r in class k with data d. I(k) is the set of rules in class k. The following steps in the partial matching classifier are the same as those in the complete matching classifier.

Description of simulations
In this section, the details of our study are presented on the profitability and accuracy of this method for weighted association rule mining to solve the stock prediction problem. The simulation was conducted by selecting 30 stocks as targets stocks. These 30 stocks are included in Dow Jones Industrial Average Index. The reason for this selection is to ensure that the target stocks are more representative. The price data on which the simulations are based were collected from April 23, 2015 to March 16, 2019. This period is divided into two parts for training and testing. The training data gathered in the period ranging from April 23, 2015 to February 23, 2018, were used for the mining association rules of two methods. The testing data were collected from February 24, 2018 to February 17, 2019, and were used to evaluate the profitability and accuracy of the mining methods. Individual stock prices from these periods were used for training and testing. This means that each of the stocks was used for mining inter-transaction association rules during the training period. Then, the trading price of this stock was determined in the testing period according to the rules that were mined in the training period. Apart from the target stocks, the stocks in the antecedent part of the association rule also need to be selected. Considering the feasibility of the calculation, 50 representative stocks were selected from a total of 1692 stocks using clustering and correlation methods. First, all 1692 stocks were separated into 50 groups by clustering methods. Then, a genetic algorithm was used to select one stock from each group. The parameters of the proposed method are listed in Table 4.
According to the classifier model, CL (mode, weight, filter, discount) was used to represent the classifier. Details of the classifiers are provided elsewhere Yang et al. (2011a). The six classifiers listed in Table 5 achieved superior results, and were used to classify the rules in this research.

Simulation results
In this experiment, the profitability and accuracy of the prediction between the weighted inter-transaction association rule and the conventional association rule were compared. A benchmark was also added in the form of a buy and hold strategy, according to which a stock is bought at the beginning and held until the end. Table 6 presents the average profitability of 30 stocks in the Dow Jones Index using six classifier models. First, the profitability of the buy&hold method and the association rule method was compared. These results demonstrate that the association rule method can help investors obtain higher returns. In the testing period, the buy&hold strategy only yields a return of 11.5%, whereas the weighted and conventional association rule methods both deliver superior performance.

Evaluation of profitability
Second, the profitability of the weighted and conventional methods was compared. In general, the weighted association rule helps investors with their profits. When the association rule method with a 1-day sliding window was used, the weighted method provided an average return of 14.7% in the testing period, while the conventional method achieved a return of 13.4%. The same results were obtained with simulations using sliding windows of 2 and 3 days. A sliding window of 2 days with the weighted association rule method provided investors with an average return of 19.5%, whereas the return was 15.3% for the sliding window of 3 days. In the case of the conventional method for the same period, the average returns were only 15.5% and 13.9% for sliding windows of 2 days and 3 days, respectively. This result can be explained by the volume, which plays an important role here. Positive and negative information can affect the trading volume of the stock market, which could potentially increase to a high level in a short time, the impact of which usually lasts for a while. When the investors in the market reach an agreement on the new price, or when the information has already been interpreted, the volume returns to the normal level after several trading days. This indicates that the weighted association rule with larger sliding windows is superior to the rule with only one window. A comparison of the profits in different sliding windows with the same mining method reveals that the 2-day sliding window is a more effective choice. Because classifiers can affect the rules, the best classifier was selected for each stock, which means that the selected classifier maximized profit. This can be used to construct a strategy for a particular stock. Table 7 indicates that the best classifier can provide a higher return compared with the buy&hold strategy. Even compared with the average return of all six classifiers, the best classifier can still be more attractive. Several stocks were selected to track the profit fluctuations resulting from the association rule methods and the buy&hold strategy. Figure 4 shows the profit fluctuation for Exxon Mobil Corp., with a sliding window of 1 day for each classifier. Note that, at the beginning of the testing period, the results are almost the same for all methods. However, after approximately 3 months, the performance of association rule methods starts to improve. Classifier 3 of the weighted methods performed the best, providing a profit of 15.3%, whereas the buy&hold strategy was less effective and only provided a profit of 3%. Figure 5 shows the profit fluctuation for J P Morgan Chase & Co, with a sliding window of 2 days. As observed in the chart, classifiers 1 and 5 of the weighted method were effective. Classifier 1 of the weighted method provided a profit of 32.9%. In the case of the buy&hold strategy, a loss of 2.5% of capital was observed. Figure 6 shows the profit fluctuation for the Coca-Cola company, with a sliding window of 3 days. As shown by the chart, classifiers 1 and 5 of the weighted method delivered good performance, and classifier 1 of the weighted method provided a profit of 18.6%, whereas the profit with the buy&hold strategy was 7.8%. Figures 4-6 show that the classifier has a strong impact on the simulation results. A suitable classifier needs to be selected for different stocks. Another point is that the length of the sliding window should suit the prediction problem; a 2-day sliding window performed the best in the simulations.

Ability to attain prediction accuracy
In this study, accuracy is defined as the correct prediction number divided by the total number of records that were tested. As mentioned above, high accuracy does not indicate high profitability. The following cases are examples from a previous study Yang et al. (2011b).
Case 1: The agent correctly predicts the results in four trading days, with each bringing a profit of 1,000 yen, but it fails to predict the result on the fifth trading day, which leads to a large loss of 10,000 yen. In this case, the loss is 6,000 yen and the prediction accuracy is 80%.  Case 2: The agent incorrectly predicts the results in four trading days, with each causing a loss of 1,000 yen, but the prediction is correct on the fifth trading day, which brings a large profit of 10,000 yen. In this case, the profit obtained is 6,000 yen, but the prediction accuracy is 20%.
These two examples clearly indicate that obtaining high profits is of key importance in correctly predicting the stock movement. The association rule, which is weighted by the trading volume, supports this point much more strongly than the conventional method because it assigns higher weights to key transactions. To verify this, the average prediction accuracy was calculated. The results are listed in Table 8.
These results demonstrate that the weighted method also has an advantage in prediction accuracy compared to the conventional one. The weighted method (with all three sliding windows) is more accurate than the conventional method. Therefore, based on the experimental results in Tables 6 and À7, the proposed weighted method can determine more important and accurate rules than the conventional method, thereby increasing the profits and improving the accuracy.

Conclusions and future work
In this paper, a weighted inter-transaction association rule mining method is proposed based on genetic network programming. The idea is that different rules are of different levels of importance to analysts. Rules with larger support and confidence might be less important than rules with little support and confidence, if association rule mining methods are used without considering weights. The weight is determined by analysts depending on the problem. In this research a method was introduced to allocate these weights. The proposed method, which can dynamically assign weights,  was applied to the stock market prediction problem to construct trading strategies.
To evaluate profitability and accuracy, the mined association rules were used to generate the trading strategy, then the results were compared with those obtained with conventional mining methods. The experimental results demonstrate that the weighted mining method extracts the key rules more effectively than the conventional method, and this characteristic achieves higher prediction accuracy and more profits than the conventional methods.
In the future, a new computational algorithm can be introduced to improve prediction accuracy. First, the trading strategy presented in this paper only includes buying, selling, and holding actions, and the profits are obtained only as a result of an increase in the price of stocks. To solve this problem, the new computational algorithm can introduce a short sales mechanism to imitate the stock market, which is expected to yield more efficient rules for prediction, thus increasing the profits. Second, since the proposed data mining and evolutionary method is not only useful in the financial market, but also in many other fields, researchers can easily use this algorithm to enhance the performances of the following systems: the elevator group supervisory control system, the multiple round bidding strategy in an English auction, the intrusion detection system for the internet, and the traffic prediction system. In general, the application of WICAR and GNP in other fields would only require changing the judgment and processing functions, fitness functions, and the simulation environment of the basic model. This means that the proposed method is widely applicable to optimization of various systems, to be determined by future research. Note 1. The term 'attribute' is usually used in the context of a database, and 'item' is usually used in the context of data mining to emphasize an item in a transaction. Note that these two concepts are essentially the same.

Funding
Chen's work is supported by National Natural Science Foundation of China (No. 71571113), and the Fundamental Research Funds for the Central Universities. Zhang's work is supported by National Natural Science Foundation of China (No. 72171192, 11771133).