# Fuzzy Frequent Pattern Mining Algorithm Based on Weighted Sliding Window and Type-2 Fuzzy Sets over Medical Data Stream

Authors: Jing Chen; Peng Li; Weiqing Fang; Ning Zhou; Yue Yin; Hui Zheng; He Xu; Ruchuan Wang
Journal: Wireless Communications and Mobile Computing
 (2021)

---

## Abstract

Real-time data stream mining algorithms are largely based on binary datasets and do not handle continuous quantitative data streams, especially in medical data mining field. Therefore, this paper proposes a new weighted sliding window fuzzy frequent pattern mining algorithm based on interval type-2 fuzzy set theory over data stream (WSWFFP-T2) with a single scan based on the artificial datasets of medical data stream. The weighted fuzzy frequent pattern tree based on type-2 fuzzy set theory (WFFPT2-tree) and fuzzy-list sorted structure (FLSS) is designed to mine the fuzzy frequent patterns (FFPs) over the medical data stream. The experiments show that the proposed WSWFFP-T2 algorithm is optimal for mining the quantitative data stream and not limited to the fragile databases; the performance is reliable and stable under the condition of the weighted sliding window. Moreover, the proposed algorithm has high performance in mining the FFPs compared with the existing algorithms under the condition of recall and precision rates.


---

## Body

## 1. Introduction

Frequent itemset mining (FIM) is the primary processing for the association rule mining (ARM, Apriori 1993) algorithm, which mines associations in the form of rules, such as “IF eat more than regular THEN have obesity,” for a dataset. The ARM algorithm has an irreplaceable advantage in real-world applications, especially in medical diagnosis and health prediction. ARM algorithm can mine potential disease-related rules. Also, traceability for disease relevant results, as ARM algorithm can easily find hidden associations between diseases and their related features in a dataset. For this reason, this paper will focus on mining frequent patterns in studying of computer-aided medical diagnosis and health prediction. In a database, the number of times an item appears refers as the item’s support and the item is a frequent item (FI) if the items’ support exceeds a defined threshold. Apriori [1], Eclat [2, 3], and FPGrowth [4, 5] algorithms are the three most classical algorithms in FIM.A significant number of improved algorithms, such as AFOPT [6–8], FPGrowth∗ [9–11], CPFGrowth [11], and BFPGrowth [12], emerged after the classic FPGrowth algorithm [4, 5] was proposed. The key step of the association rule mining (ARM) algorithm is the FPM, which can process and analyze the association relationship corresponding to Boolean variables, sequences, or transactions, but cannot directly process the quantitative values represented by floating point numbers [13, 14].In order to solve the problem, researchers began studying the discretization of the attribute features of continuous data into category attributes to discover the implicit association rules. Lee (1997) introduced fuzzification into the ARM algorithm [15] that the user would influence the process of discovery and obtain the details of rules discovered. The aim of fuzzy transformation is to convert the quantitative data into fuzzy data.The ARM has been improved to process the continuous data by implementing new rules or integrating several algorithms, such as incorporating a new “interest” metric [16] and inserting additional rule templates [17], implementing the bottom-up grouping method [18, 19], and introducing genetic algorithm [19, 20]. Moreover, in order to validate the ARM [21–23], the threshold condition could be continuously practiced based on minimum support and confidence.The approach used above is to directly transform the continuous data into a crisp category. Sharp edges will emerge [24] if the transformed numerical attributes are located near the interval segmentation points, causing the issue of matching the segmentation points and the precision of the algorithm.The research gap is how to minimize the issue of sharp boundaries; researchers started to implement the fuzzy association rule mining (FARM) algorithm in their research. These methods [25–28] apply the fuzzy theory to expand the clear interval to membership value interval for the mining the fuzzy association rules dealing with quantitative data. The fuzzy sets [29, 30] that correspond to the membership preserve the interval of the numerical attributes in the fuzzification process [31], which increases the amount of information on the transformed numerical data and decreases the sharp boundaries issue.Hong et al. [32] introduced two different support thresholds instead of conventional thresholds to divide the candidate frequent itemsets into parts of different meanings, thus minimizing the workload of rescanning the initial dataset. The process of fuzzification is to extend the space to the fuzzy space. The main reason for the imbalance of fuzzy sets is that the amount of data in the central fuzzy set obtained by the fuzzy transformation increases, thereby increasing the additional fuzzy membership. Hong et al. [33] proposed a FARM based on the type-1 fuzzy set theory. The type-2 fuzzy set theory [34] was introduced to solve the problem of FARM in the regular database [35]. The methods of literature [32–35] inspired the motivation to solve the fuzzy association rule mining over medical quantitative data stream based on type-2 fuzzy set theory.To the best of the authors’ knowledge, there is no relevant research focused on the weighted sliding window to mine the FFIs over quantitative data stream based on type-2 fuzzy set theory to bridge the understanding between computers and human beings without the expert suggestions. This paper improves the model and proposes a new weighted sliding window quantitative data stream frequent pattern mining algorithm based on type-2 fuzzy set theory.In this paper, the WSWFFP-T2 algorithm is proposed to efficiently mine the FFIs with one scan over the medical data streams. For the dynamic FFPs mining process, a fuzzy-list sorted structure and a WFFPT2-tree are suggested. The main contributions of this article are as follows:(1)
In order to distinguish the weights of historical and recent transactions, the weighted sliding window with decay factor is adopted that simultaneously overcomes the problem of unexpected concept drift in the number of items in data streams. Recall and precision rates are applied to control the influence of the decay factor on the frequent patterns and the critical frequent patterns of the sliding window(2)
A novel WSWFFP-T2 algorithm over medical data streams is proposed to efficiently mine the FFPs with only one scan using a fuzzy-list sorted structure (FLSS) and WFFPT2-tree. The construction and the deletion strategies are used in the form of a linked list to construct and maintain the WFFPT2-tree. Various examples and figures are provided to better understand the interval type-2 fuzzy sets theory mining process over the quantitative data stream(3)
The proposed WSWFFP-T2 algorithm is compared with the previous related algorithms to evaluate its performance. Several synthetic data streams applying decay factors with sliding window are used in the performance evaluation. The experimental results show that the proposed algorithm presents more outstanding performance than the previous onesThe rest of this paper is organized as follows. Related works and preliminaries are introduced in Sections2 and 3, respectively. The proposed algorithm is presented in Section 4. An experimental study is illustrated in Section 5. Finally, Section 6 concludes this paper.


## 2. Related Works and Research Problems

This section briefly reviews the studies concerning sliding window [36] with fading factor, type-2 fuzzy sets theory, and the PF-tree algorithm from the quantitative data streams.


### 2.1. Sliding Window with Fading Factor

Under some conditions, especially in the data stream, new transactions are much more important than the historical transactions when mining the data streams. In order to distinguish the new and the old transactions and consider the importance of the latest data, the literature MSW [37] and SWP-tree [38] set different weights for the old and the new transactions. Obtaining a more reasonable frequent itemset will produce a large number of redundant patterns. The classical algorithms based on the window model include lossy count [39] and DSM_FT [40]. The most common window model is the sliding window model. For example, the algorithms MSW [38], MFI-CBSW [41], MFI-TimeSW [42], and TMFI [43] use the sliding window models to mine the frequent patterns in the data streams. The classical algorithms based on the attenuation model are estDec [44] and estDec+ [45]. According to the characteristics of the pattern, it can be divided into frequent patterns, frequent sequence patterns, frequent tree patterns, and frequent graph pattern mining methods.


### 2.2. Interval Type-2 Fuzzy Set Theory

Based on the pattern growth mechanism, Lin et al. [46] used the fuzzy frequent pattern tree method to discover the set of FFIs. When the transaction volume is large, this method may require a significant amount of calculation. Therefore, the compressed fuzzy frequent pattern (CFFP) tree algorithm [47] has been used to reduce the size of the frequent pattern tree. Compared with the FFP-tree algorithm, the CFFP algorithm significantly reduces the number of tree nodes in the CFFP tree. However, it is necessary to reserve an additional array for each node to store the current processing node and the membership value. Therefore, the CFFP algorithm requires a large of memory to store this information, which is inefficient in a very sparse database. In order to solve this problem, the UBFFPT-tree [48] algorithm not only retains the simplified tree structure but also mines the fuzzy frequent itemsets in limited memory, which can effectively mine the FFIs with the same tree node size as the CFFP-tree algorithm. The above algorithm only uses one language word to represent the item being processed in the database, so the information found may be incomplete and insufficient. The above method uses type-1 fuzzy set theory without considering the uncertainty factor.This concept has also been widely used in intelligent information systems. In data mining, when dealing with a transaction database with sales quantity information, the idea of fuzzy sets can be used to transform the number of items into language. It uses the semantic terms to express the concepts, which is more in line with human thinking. Fuzzy data mining algorithms have been proposed aiming at language association rules [49] and other issues.To solve this limitation, the researchers designed and implemented a type-2 fuzzy set theory that considers the uncertainty problem. In 1965, Zadeh [50] proposed type-1 fuzzy set (T1-FS theory) and then the type-1 fuzzy logic system (T1-FLS) based on T1-FS to solve the problem of uncertainty, fuzzy, and inaccurate modeling method. Since the T1-FLS is represented by an accurate membership function, its ability to directly deal with the uncertainty of fuzzy rules is limited. Karnik and Mendel [51] proposed a type-2 fuzzy set (type-2 FS, T2-FS) that blurred the membership degree in the fuzzy set, that is, the membership degree itself was T1-FS, and T2-FS was enhanced. Chen et al. [52] proposed a priori-based standard method to discover FFI with type-2 fuzzy sets. The algorithm used a generation test mechanism based on fuzzy two-category membership functions to find the candidate objects hierarchically.Interval type-2 fuzzy set [53] is an extension of traditional type-1 fuzzy set. Its essence is to defuzzify the membership value in the fuzzy set. The interval type-2 fuzzy set theory can directly deal with the uncertainty of fuzzy rules. Using the membership function of the second type of fuzzy set theory to mine the FFPs requires the use of a central mechanism to convert the fuzzy value (interval) of language terms into fuzzy values, which requires more time complexity to generate the candidate identification codes. The proposed algorithm adopts type-2 fuzzy set theory.Type-2 FSs are described by the MFs that are characterized by more parameters than the MFs for type-1 FSs. Hence, the type-2 FSs provide more design degrees of freedom [54]. Therefore, the use of type-2 fuzzy sets has the potential to outperform the use of type-1 fuzzy sets, especially, in uncertain environments.


## 2.1. Sliding Window with Fading Factor

Under some conditions, especially in the data stream, new transactions are much more important than the historical transactions when mining the data streams. In order to distinguish the new and the old transactions and consider the importance of the latest data, the literature MSW [37] and SWP-tree [38] set different weights for the old and the new transactions. Obtaining a more reasonable frequent itemset will produce a large number of redundant patterns. The classical algorithms based on the window model include lossy count [39] and DSM_FT [40]. The most common window model is the sliding window model. For example, the algorithms MSW [38], MFI-CBSW [41], MFI-TimeSW [42], and TMFI [43] use the sliding window models to mine the frequent patterns in the data streams. The classical algorithms based on the attenuation model are estDec [44] and estDec+ [45]. According to the characteristics of the pattern, it can be divided into frequent patterns, frequent sequence patterns, frequent tree patterns, and frequent graph pattern mining methods.


## 2.2. Interval Type-2 Fuzzy Set Theory

Based on the pattern growth mechanism, Lin et al. [46] used the fuzzy frequent pattern tree method to discover the set of FFIs. When the transaction volume is large, this method may require a significant amount of calculation. Therefore, the compressed fuzzy frequent pattern (CFFP) tree algorithm [47] has been used to reduce the size of the frequent pattern tree. Compared with the FFP-tree algorithm, the CFFP algorithm significantly reduces the number of tree nodes in the CFFP tree. However, it is necessary to reserve an additional array for each node to store the current processing node and the membership value. Therefore, the CFFP algorithm requires a large of memory to store this information, which is inefficient in a very sparse database. In order to solve this problem, the UBFFPT-tree [48] algorithm not only retains the simplified tree structure but also mines the fuzzy frequent itemsets in limited memory, which can effectively mine the FFIs with the same tree node size as the CFFP-tree algorithm. The above algorithm only uses one language word to represent the item being processed in the database, so the information found may be incomplete and insufficient. The above method uses type-1 fuzzy set theory without considering the uncertainty factor.This concept has also been widely used in intelligent information systems. In data mining, when dealing with a transaction database with sales quantity information, the idea of fuzzy sets can be used to transform the number of items into language. It uses the semantic terms to express the concepts, which is more in line with human thinking. Fuzzy data mining algorithms have been proposed aiming at language association rules [49] and other issues.To solve this limitation, the researchers designed and implemented a type-2 fuzzy set theory that considers the uncertainty problem. In 1965, Zadeh [50] proposed type-1 fuzzy set (T1-FS theory) and then the type-1 fuzzy logic system (T1-FLS) based on T1-FS to solve the problem of uncertainty, fuzzy, and inaccurate modeling method. Since the T1-FLS is represented by an accurate membership function, its ability to directly deal with the uncertainty of fuzzy rules is limited. Karnik and Mendel [51] proposed a type-2 fuzzy set (type-2 FS, T2-FS) that blurred the membership degree in the fuzzy set, that is, the membership degree itself was T1-FS, and T2-FS was enhanced. Chen et al. [52] proposed a priori-based standard method to discover FFI with type-2 fuzzy sets. The algorithm used a generation test mechanism based on fuzzy two-category membership functions to find the candidate objects hierarchically.Interval type-2 fuzzy set [53] is an extension of traditional type-1 fuzzy set. Its essence is to defuzzify the membership value in the fuzzy set. The interval type-2 fuzzy set theory can directly deal with the uncertainty of fuzzy rules. Using the membership function of the second type of fuzzy set theory to mine the FFPs requires the use of a central mechanism to convert the fuzzy value (interval) of language terms into fuzzy values, which requires more time complexity to generate the candidate identification codes. The proposed algorithm adopts type-2 fuzzy set theory.Type-2 FSs are described by the MFs that are characterized by more parameters than the MFs for type-1 FSs. Hence, the type-2 FSs provide more design degrees of freedom [54]. Therefore, the use of type-2 fuzzy sets has the potential to outperform the use of type-1 fuzzy sets, especially, in uncertain environments.


## 3. Preliminaries

At present, most FFPs algorithms are based on the framework and algorithm evolution of Apriori [1] and FPGrowth [4]. However, these methods cannot handle the data stream immediately. In the process of the data stream mining, some projects rarely appear as time goes by, but as new transactions continue to increase, they may become more frequent in the future. According to the dynamic changes of the data, the importance of the data itself also changes. Therefore, different data processing models should be adopted according to the changing law of the data. When the importance of the data gradually decreases, the attenuation model should be used for data processing. The important factor in the attenuation model is the attenuation rate factor.Definition 1 (quantitative data stream (QDS)).
GivenI=I1,I2,⋯,Im is the set of items, the QDS is a sequence T1,T2,⋯,Tn that arrives continuously at a certain speed represented by quantitative values, where Ti represents the ith transaction 1≤i≤k, for any given Ti has Ti⊂I.Definition 2 (weighted sliding window [36]).
The start and end of the sliding windoww=w1,w2,⋯,wn are determined by the batch and the current time, and each has its decay factor during the data stream mining process. The window contains 3 batches, and each batch contains two time series. As shown in Figure 1, the first sliding window w1 contains three batches like B1,B2,B3. The batch B1 contains two T1 and T2. The number of batches in the algorithm implemented in this paper can be adjusted according to the actual situation of the actual data stream, meaning it is a variable dynamic weighted sliding window.Figure 1
Data list of the data stream.Definition 3 (decay factor [55, 56]).
The decay factorδ refers to the attenuation degree of data over time. In the sliding window model where data elapses over time, the knowledge contained in the patterns in the latest window is more important or valuable than the patterns in the historical window. For example, the reference value of the current monitored medical data is larger than in the past, and the monitoring data has a more important reference value for medical diagnosis and prediction.Definition 4 (frequent pattern).
N is the number of current transaction items in the data stream. Let θ be the minimum support threshold. If the pattern P satisfies Equation (1), P is a frequent pattern.
(1)freqP,N≥θ×N.Definition 5 (error factor).
The error factorε is the maximum allowable error threshold ε∈0,θ. If the pattern P satisfies Equation (2), then P is a critical frequent pattern.
(2)θ×N≥freqP,N≥ε×N.If freqP,N<ε×N, then P is an infrequent pattern.Definition 6 (lingual variable [35]).
There is the following relationshipi⊂I; the value of the lingual variable is determined according to the membership value given by the user.
Example: the membership relationship in Figure2 can be transformed into the interval represented by Ri1,Ri2,⋯,Rih through the type-2 fuzzy process. For example, Figure 2 shows 10 sequences through which the data stream passes, and the corresponding data items T1 are (d:4), (b:1), (e:5). The value of i is represented by viq, so the items in T1: (b), (d), and (e) are transformed as vd1=4, vb1=1, and ve1=1, respectively.Figure 2
Quantitative data stream with sliding window.


## 4. Proposed WSWFFP-T2 Algorithm

The proposed WSWFFP-T2 algorithm consists of four phases for mining the FFPs. The first phase is the data stream input whose value is the object’s quantitative data, not the crisp database. The second phase consists of two steps, the weighted sliding window and the fuzzy-preprocessing, based on the interval type-2 fuzzy theory including the original fuzzification and fuzzy compression process. From quantitative data to linguistic value, the membership attribute was transformed and further details would be presented in the second phrase. In order to avoid the problem of concept drift [57], the decay and the error factors are used during the weighted sliding window over the data stream process to generate the frequent patterns and the critical frequent patterns. The third phase is the construct-delete process of WFFPT2-tree with fuzzy-list sorted structure. The WFFPT2-tree-based algorithm for generating FFPs is the last step. Figure 3 presents the structure of the WSWFFP-T2 algorithm.Figure 3
Proposed WSWFFP-T2 Algorithm Structure.


### 4.1. Preprocessing Fuzzification

#### 4.1.1. Prefuzzification Based on Interval Type-2 Fuzzy Theory

For the designed WSWFFP-T2 algorithm to mine the FFPs on a data stream, the quantitative attribute should be first fuzzified by the defined membership functions based on the interval type-2 fuzzy theory. The step is called the preprocessing of the fuzzification because the fuzzified data should be compacted after the first step. In the preprocessing of the fuzzification, the quantitative attribute is transformed into a linguistic value (low, middle, and high) as shown in Figure4. Equations (3)–(5) are the transformed functions that have three groups like fvlowlower,fvlowupper, fvmidlower,fvmidupper, and fvhighlower,fvhighupper, and the value of distance “a” can be defined by the user according to the actual demand. For example, the original quantitative data T1:d:4,b:1,e:5 shown in Figure 2 is then transformed into membership attribute in Figure 4, and the fuzzified results are listed in Figure 5.Figure 4
Membership function in type-2 fuzzy set theory.Figure 5
The initial value of quantitative data after fuzzy conversion from Figure2.The membership function construction methods of two interval fuzzy sets are the individual member function method and the interval endpoint method. Figure4 shows the membership μ of type-2 fuzzy set theory. The abscissa is the size of different transactions, and the ordinate is the degree of membership. The language terms low (L), medium (M), and high (H) are used to denote the division of different intervals. At the same time, the users can formulate expressions of language terms according to the actual application requirements.(3)fvlowlower=1,X≤1,−12x+32,1<X≤3,0,X>3,fvlowupper=1,X≤1,−12+ax+3+a2+a,1<X≤3+a,0,X>3+a,(4)fvmidlower=0,X≤1,12x−12,1<X≤3,−12x+52,3<X≤5,0,X>5,fvmidupper=0,X≤1−a,12+ax+a−12+a,1−a<X≤3,−12+ax+5+a2+a,3<X≤5+a,0,X>5+a,(5)fvhighlower=0,X≤3,12x−32,3<X≤5,1,X>5,fvhighupper=0,X≤3−a,12+ax+a−32+a,3−a<X≤5,1,X>5.After the prefuzzification of interval type-2 fuzzy set theory, the fuzzified data structure is presented asfv.upper,fv.lower/Iname.ftp, where the Iname represents the name of the item and fv.upper,fv.lower is the membership value calculated from Equations (3)–(5). In order to unify the abbreviation, after the initial fuzzy conversion, the linguistic attributes of ftp (fuzzy type) like low, mid, and high are represented as Iname.L, Iname.M, and Iname.H, respectively.Definition 7.
The linguistic term set is represented asfiq, and the corresponding membership degree or called fuzzy value could have the membership degree relationship of type-2 fuzzy theory which is defined as fiq=μiviq in the following:
(6)fiq=fviq1lower+fviq1upperRi1+fviq2lower+fviq2upperRi2+⋯+fviqhlower+fviqhupperRih.For instance, the item (d) in Tid1 has a corresponding value of 4, which can be converted as follows:
(7)0.5,0.63d.M+0.5,0.63d.H.Therefore, the items (d:4), (b:1), and (e:5) in T1 are transformed from quantitative data to linguistic terms (d.M, d.H, b.L, b.M, e.M, and e.H), and the conversion results of all itemsets in Figure 2 can be indicated in Figure 5 based on the defined split point number.
(8)0.5,0.63d.M+0.5,0.63d.H,1,1b.L+0,0.25b.M,0,0.25e.M+1,1e.H.


#### 4.1.2. The Fuzzy Compression Process

To reduce the complexity of the preprocessing step, the interval value is represented by the fuzzy compression process as defined in Definition8. For example, in the transaction T1 shown in Figure 5, the item (d) with its quantity 4 is then transformed as 0.5,0.63/d.M+0.5,0.63/d.H. Then, the interval is transformed as 0.5+0.63/2=0.56 using the type-reduction method with the defined split point number according to Equation (9). After that, both d.M and d.H are reduced as 0.56/d.M+0.56/d.H in Figure 6.Definition 8.
The membership degree of a linguistic termRih in the fuzzified dataset D′ is denoted as fviqhc [35] and defined as follows:
(9)fviqhc=fviqhlower+fviqhupper2.Figure 6
Fuzzy compression results from Figure5.


### 4.2. Weighted Sliding Window Model

In this paper, the sliding window model based on the average decay factor (ADF) is applied to construct the WFFPT2-tree of the type-2 fuzzy set [51] to mine the fuzzy frequent patterns (FFPs). The ADF was proposed by Han and Ding [55] for mining the FPs on the transaction data stream, but not for the quantitative data stream. The combination of the sliding window and the ADF not only considers the latest data in a limited time window but also fully considers the influence of historical data. The mining process of the FFPs on the data streams can effectively improve the integrity of the regular patterns. Moreover, the sliding window uses an improved decay factor δ to assign different weights to the new and the old data in different periods. When the data stream continues to arrive, the itemset changes steadily, avoiding the problem of data concepts drifting in the sliding window with the error factor.Based on the continuity of the data stream, the knowledge contained therein will change over time. Usually, the importance or the value of the recent transactions is greater. Therefore, a decay factor is used in this paper to weight the transactions. According to the definition of the decay factorδ, it can be seen that the smaller the value, the less important the corresponding data, and the faster the attenuation. Conversely, the larger the value, the greater the importance and the slower the decay.
(10)δ∈0,1.In the time decay model [58, 59], the data of the sliding window wn has the same decay factor δ. In the sliding window wn, the support value freqP,wn of the item P can be represented as follows:
(11)freqwP,wn=δ,n=1,freqwP,wn−1×δ+r,n≥2,(12)r=1,P∈wn,0,P∉wn.Literature [55] used a time decay model to mine the frequent patterns of the data stream closure through experiments. It is found through experiments that the mode support number after using the decay factor in the time attenuation model is much smaller than the support number without attenuation. If it is performed according to the conventional minimum support, the mining will lose possible frequent patterns. In order to solve this problem, the maximum allowable error factor is ε. In other words, both the FPs and the critical FPs (Definitions 4 and 5) will be saved during the mining process.
(13)freqwP,wn=freqwP,wn−1×δ+r=∑iri×δn−i=r1×δn−1+r2×δn−2+⋯+rm≤δn−1+δn−2+⋯+rm≤11−δ.The decay factor of the sliding windowwi∈w1,w2,⋯,wn is used to divide the value based on the fuzzification process including the three batches Bi, Bi+1, and Bi+2. Each batch contains two itemsets in chronological order in the data stream, and the size of the sliding window can be changed.After determining the minimum support and the maximum allowable error thresholds according to the literature [38], the assumed 100% recall and 100% accuracy rates are used to estimate the decay factor δ. That is, when the recall rate is 100%, Equation (14) is satisfied, which is called the lower limit δrecall. While, when the accuracy rate is 100%, Equation (15) is satisfied as the upper limit δprecision.
(14)δ≥θ−εθ22N−θN−1Recall=100%,(15)δ<θ−εN−1θ−εNPrecision=100%.Since both recall and accuracy cannot be considered at the same time, the choice of decay factor needs to balance the two. Therefore, this article uses the average valueδaverage of the upper and the lower limits as used in the literature [59].
(16)δaverage=δrecall+δprecision2.Definition 9.
The support value of a linguistic term is denoted assupRjh, which is the scalar cardinality of each fuzzy frequent item [35] and is defined as follows:
(17)supRih=∑Rjh⊆Tq∧Tq∈D′fviqhc.According to Definitions4 and 5, when the minimum support θ, the average decay factor δaverage, and the error factor ε are known, the frequent pattern and the critical frequent patterns weighted by the sliding window can be obtained according to Equations (11) and (13), respectively. Then, the patterns are sorted in descending order according to the accumulated count value of the frequent patterns and the critical frequent patterns as shown in Figure 7. Despite the prefuzzification step performed first, the weighted sliding window method will significantly change the count value of the item after multiple iterations due to the variability and the continuous characteristics of the data stream. The FFPs and the critical FFPs are listed in Figure 7. After the weighted sliding window process, there are critical FFPs that reflect the increment part based on the minimum support value designed by the user, which can reduce the concept drift problem.Figure 7
Descending order of frequent pattern and critical frequent patterns.


### 4.3. The Construction-Renew Process of WFFPT2-Tree

This paper uses fuzzy-list sorted structure and WFFPT2-tree to generate fuzzy frequent patterns. The fuzzy-list sorted structure is used to store the attributes of the fuzzy frequent items after the prefuzzification. The attributes of FFIs include the name of the fuzzy frequent item, the count, and the link node. The construction process of WFFPT2-tree consists of adding transactions and deleting the transactions based on the fuzzy-list sorted structure. The proposed WFFPT2-tree is improved from the FP-tree [5]. The WFFPT2-tree with fuzzy-list sorted structure will reduce the memory usage and speed up the mining process.In the WFFPT2-tree structure, each node represents a fuzzified semantic tree transaction, which includes the weighted fuzzified semantic representation of itemsets and the corresponding membership and count values. Since the list is sorted in descending order first, the cache is stored in the form of a queue. Figure8 shows the construction process of the WFFPT2-tree according to Figure 7.Figure 8
WFFPT2-Tree construction process of Transaction T1 to T3.The idea of generating fuzzy pattern trees in descending order adopted in this paper is derived from the tail expansion strategy. This paper adopts the horizontal link to quickly find the corresponding node on the node of the prefix pattern tree. The horizontal link will link the nodes with the same fuzzy linguistic in the descending prefix pattern tree, but the count value will be different, which is convenient for searching and inserting new subtrees or single nodes during the sliding window process.


#### 4.3.1. Inserting Phase of the New Tree Transaction

The construction of the WFFPT2-tree is based on the fuzzy-list sorted structure. When the new tree transactionTk generates, it will be added in the tree with the link node and sorted in the fuzzy-list structure. The specific implementation process is as follows. The fuzzy-list sorted structure table contains the frequent and the critical frequent patterns after the weighted sliding window and sorted by the count value as shown in Figure 9.Figure 9
WFFPT2-tree construction result of the sliding windoww1.When the WFFPT2-tree is empty, the first fuzzified transactionT1 through the weighted sliding window contains three fuzzy frequent items T1:0.13/b.M:1+1/b.L:1+0.56/d.M:1, which are inserted into the root header in descending order. When the T2 comes, the descending subtree has the same patterns and then the count increases as shown in Figure 8. When T3 enters, there is no identical node in the current prefix pattern tree, so a new subtree is established. Figure 8 shows the detailed process of adding new branches to the fuzzy frequent pattern tree.A similar process can be obtained whenT4, T5, and T6 are added to WFFPT2-tree in Figure 9. Figure 9 shows the sorted list structure of all items in the sliding window w1, including the fuzzy semantic names, the decay factor, and the link node.


#### 4.3.2. Deleting Phase of the Old Tree Transaction

This operation occurs during the sliding phase of the weighted sliding window over the data stream. For example, after the establishment of tree transactions ofw1 shown in Figure 9, the fuzzy frequent transactions enter from w1 to w2 stage, which should be adding to the WFFPT2-tree shown in blue in Figure 10 and the old tree transactions should be deleted shown in red in Figure 10. First, pop a piece of data from the front of the fuzzy-list sorted structure table, and use the pointer to point to the end of the tree transaction in the WFFPT2-tree to find the transaction which needs to be deleted in the tree. Then, from the tail of the WFFPT2-tree to the root, update the count value of the node along the path. It can be seen from the path that the red part whose weighted count value does not meet the minimum support needs to be deleted from the tree. Usually, their horizontal links are also deleted at the same time.Figure 10
WFFPT2-tree construction process of the sliding window fromw1 to w2.Figure10 shows the new node in the sliding window in blue and the results of the deletion. Figure 11 shows the current WFFPT2-tree of the sliding window w2 after deleting the node. Figures 12 and 13 show the processes of adding and deleting after the sliding window w3 has passed, respectively. Figures 8–13 show the example of WSWFFP-T2 algorithm and illustrate the entire process of the sliding window based on the fuzzy-list sorted structure in the proposed algorithm, including the processes of construction and adding and deleting the fuzzy node.Figure 11
WFFPT2-tree construction result of the sliding windoww2.Figure 12
WFFPT2-tree construction process of the sliding window fromw2 to w3.Figure 13
WFFPT2-tree construction result of the sliding windoww3.


#### 4.3.3. FFPs Mining Phase

The mining process of frequent patterns is performed by querying the mining results of the current window. In the WFFPT2-tree, all frequent patterns can be mined through recursion to facilitate the finding of the entire WFFPT2-tree, and the patterns with support greater than the threshold are frequent patterns. Although the WSWFFP-T2 algorithm proposed in this paper mines frequent patterns with a fixed window size, the processes of inserting the new nodes and deleting the nodes in the algorithm are independent of each other. Thus, increasing and reducing the number of sliding windows will not affect the correctness of the algorithm. This part is also tested and verified in subsequent experiments. The algorithm can easily be applied to the variable-length sliding window model.


#### 4.3.4. The Pseudocode of the Proposed WFFPT2-Tree Algorithm

Algorithm 1: WFFPT2-tree algorithm.
Input:Int SizeP//the size of BatchInt Sizew//the size of the windowDouble minsup //the minimum support valueList ItemTalbe//the fuzzy-list sorted-structure tableList InstanceList//the storage table of InstanceArffFIleStream Arff//Arff data streamOutput:FFPsMain(){//main function1 Arff.LoadArffFIle();//Read in data stream and fuzzify linguistic data based on type 2 fuzzification method2  CreateWFFPWindow();//Create the weighted sliding window3  While(Arff.hasInstance!=nul)//Read data stream4   {5    Instance=LoadNextInstance();//read the next instance6    FuzzySetCompute(instace);//Calculate the membership degree of type 2 fuzzy set by formula7    Compress(Tmp);//Compression of the fuzzy calculation result; ;8    UpdateWFFPWindows();//update the weighted fuzzy frequent window9   }10  OutputFFPT2(minsup); //Output fuzzy frequent patterns meeting the minimum support degree;11  }Sub Algorithm1: CreateWFFPWindow1 CreateWFFPWindow(){2  Times=0;3  While(Times<SizeW){4  Instance=Arff.nextInstace();//Read according to the window size5  UpdateItem(Instance); //Update Item table6  InstanceList.add(Instance);7  }8  //ItemTable sorts itself first, and obtains the path Order according to the Count in the Item table9  ItemTable.sort();10  Getorder();11  InstanceList.SortByOrder();//Sort the instances in Oder order12  CreateTree(InstanceLIst);//Insert the instance into the tree13  }Sub Algorithm 2: FuzzySetCompute1  FuzzySetCompute(instance){2  //Calculate F.lower() and F.upper() according to the model3  Tmp.add(F.lower(),F.upper());4  }Sub Algorithm 3: UpdateWFFPWindows1  UpdateWFFPWindows{      //Update window2  DelTree();  //Same as createwindow(), delete the old pane instance from the tree3 }Sub Algorithm 4: OutputFFPs1  OutputPPFs(minsup){2  //caculate the Sup(Item) from ItemTable3  If sup(item)>minsup{4  //output the results through the corresponding Item.Link5  OutputFromLink(item);6  }}


## 4.1. Preprocessing Fuzzification

### 4.1.1. Prefuzzification Based on Interval Type-2 Fuzzy Theory

For the designed WSWFFP-T2 algorithm to mine the FFPs on a data stream, the quantitative attribute should be first fuzzified by the defined membership functions based on the interval type-2 fuzzy theory. The step is called the preprocessing of the fuzzification because the fuzzified data should be compacted after the first step. In the preprocessing of the fuzzification, the quantitative attribute is transformed into a linguistic value (low, middle, and high) as shown in Figure4. Equations (3)–(5) are the transformed functions that have three groups like fvlowlower,fvlowupper, fvmidlower,fvmidupper, and fvhighlower,fvhighupper, and the value of distance “a” can be defined by the user according to the actual demand. For example, the original quantitative data T1:d:4,b:1,e:5 shown in Figure 2 is then transformed into membership attribute in Figure 4, and the fuzzified results are listed in Figure 5.Figure 4
Membership function in type-2 fuzzy set theory.Figure 5
The initial value of quantitative data after fuzzy conversion from Figure2.The membership function construction methods of two interval fuzzy sets are the individual member function method and the interval endpoint method. Figure4 shows the membership μ of type-2 fuzzy set theory. The abscissa is the size of different transactions, and the ordinate is the degree of membership. The language terms low (L), medium (M), and high (H) are used to denote the division of different intervals. At the same time, the users can formulate expressions of language terms according to the actual application requirements.(3)fvlowlower=1,X≤1,−12x+32,1<X≤3,0,X>3,fvlowupper=1,X≤1,−12+ax+3+a2+a,1<X≤3+a,0,X>3+a,(4)fvmidlower=0,X≤1,12x−12,1<X≤3,−12x+52,3<X≤5,0,X>5,fvmidupper=0,X≤1−a,12+ax+a−12+a,1−a<X≤3,−12+ax+5+a2+a,3<X≤5+a,0,X>5+a,(5)fvhighlower=0,X≤3,12x−32,3<X≤5,1,X>5,fvhighupper=0,X≤3−a,12+ax+a−32+a,3−a<X≤5,1,X>5.After the prefuzzification of interval type-2 fuzzy set theory, the fuzzified data structure is presented asfv.upper,fv.lower/Iname.ftp, where the Iname represents the name of the item and fv.upper,fv.lower is the membership value calculated from Equations (3)–(5). In order to unify the abbreviation, after the initial fuzzy conversion, the linguistic attributes of ftp (fuzzy type) like low, mid, and high are represented as Iname.L, Iname.M, and Iname.H, respectively.Definition 7.
The linguistic term set is represented asfiq, and the corresponding membership degree or called fuzzy value could have the membership degree relationship of type-2 fuzzy theory which is defined as fiq=μiviq in the following:
(6)fiq=fviq1lower+fviq1upperRi1+fviq2lower+fviq2upperRi2+⋯+fviqhlower+fviqhupperRih.For instance, the item (d) in Tid1 has a corresponding value of 4, which can be converted as follows:
(7)0.5,0.63d.M+0.5,0.63d.H.Therefore, the items (d:4), (b:1), and (e:5) in T1 are transformed from quantitative data to linguistic terms (d.M, d.H, b.L, b.M, e.M, and e.H), and the conversion results of all itemsets in Figure 2 can be indicated in Figure 5 based on the defined split point number.
(8)0.5,0.63d.M+0.5,0.63d.H,1,1b.L+0,0.25b.M,0,0.25e.M+1,1e.H.


### 4.1.2. The Fuzzy Compression Process

To reduce the complexity of the preprocessing step, the interval value is represented by the fuzzy compression process as defined in Definition8. For example, in the transaction T1 shown in Figure 5, the item (d) with its quantity 4 is then transformed as 0.5,0.63/d.M+0.5,0.63/d.H. Then, the interval is transformed as 0.5+0.63/2=0.56 using the type-reduction method with the defined split point number according to Equation (9). After that, both d.M and d.H are reduced as 0.56/d.M+0.56/d.H in Figure 6.Definition 8.
The membership degree of a linguistic termRih in the fuzzified dataset D′ is denoted as fviqhc [35] and defined as follows:
(9)fviqhc=fviqhlower+fviqhupper2.Figure 6
Fuzzy compression results from Figure5.


## 4.1.1. Prefuzzification Based on Interval Type-2 Fuzzy Theory

For the designed WSWFFP-T2 algorithm to mine the FFPs on a data stream, the quantitative attribute should be first fuzzified by the defined membership functions based on the interval type-2 fuzzy theory. The step is called the preprocessing of the fuzzification because the fuzzified data should be compacted after the first step. In the preprocessing of the fuzzification, the quantitative attribute is transformed into a linguistic value (low, middle, and high) as shown in Figure4. Equations (3)–(5) are the transformed functions that have three groups like fvlowlower,fvlowupper, fvmidlower,fvmidupper, and fvhighlower,fvhighupper, and the value of distance “a” can be defined by the user according to the actual demand. For example, the original quantitative data T1:d:4,b:1,e:5 shown in Figure 2 is then transformed into membership attribute in Figure 4, and the fuzzified results are listed in Figure 5.Figure 4
Membership function in type-2 fuzzy set theory.Figure 5
The initial value of quantitative data after fuzzy conversion from Figure2.The membership function construction methods of two interval fuzzy sets are the individual member function method and the interval endpoint method. Figure4 shows the membership μ of type-2 fuzzy set theory. The abscissa is the size of different transactions, and the ordinate is the degree of membership. The language terms low (L), medium (M), and high (H) are used to denote the division of different intervals. At the same time, the users can formulate expressions of language terms according to the actual application requirements.(3)fvlowlower=1,X≤1,−12x+32,1<X≤3,0,X>3,fvlowupper=1,X≤1,−12+ax+3+a2+a,1<X≤3+a,0,X>3+a,(4)fvmidlower=0,X≤1,12x−12,1<X≤3,−12x+52,3<X≤5,0,X>5,fvmidupper=0,X≤1−a,12+ax+a−12+a,1−a<X≤3,−12+ax+5+a2+a,3<X≤5+a,0,X>5+a,(5)fvhighlower=0,X≤3,12x−32,3<X≤5,1,X>5,fvhighupper=0,X≤3−a,12+ax+a−32+a,3−a<X≤5,1,X>5.After the prefuzzification of interval type-2 fuzzy set theory, the fuzzified data structure is presented asfv.upper,fv.lower/Iname.ftp, where the Iname represents the name of the item and fv.upper,fv.lower is the membership value calculated from Equations (3)–(5). In order to unify the abbreviation, after the initial fuzzy conversion, the linguistic attributes of ftp (fuzzy type) like low, mid, and high are represented as Iname.L, Iname.M, and Iname.H, respectively.Definition 7.
The linguistic term set is represented asfiq, and the corresponding membership degree or called fuzzy value could have the membership degree relationship of type-2 fuzzy theory which is defined as fiq=μiviq in the following:
(6)fiq=fviq1lower+fviq1upperRi1+fviq2lower+fviq2upperRi2+⋯+fviqhlower+fviqhupperRih.For instance, the item (d) in Tid1 has a corresponding value of 4, which can be converted as follows:
(7)0.5,0.63d.M+0.5,0.63d.H.Therefore, the items (d:4), (b:1), and (e:5) in T1 are transformed from quantitative data to linguistic terms (d.M, d.H, b.L, b.M, e.M, and e.H), and the conversion results of all itemsets in Figure 2 can be indicated in Figure 5 based on the defined split point number.
(8)0.5,0.63d.M+0.5,0.63d.H,1,1b.L+0,0.25b.M,0,0.25e.M+1,1e.H.


## 4.1.2. The Fuzzy Compression Process

To reduce the complexity of the preprocessing step, the interval value is represented by the fuzzy compression process as defined in Definition8. For example, in the transaction T1 shown in Figure 5, the item (d) with its quantity 4 is then transformed as 0.5,0.63/d.M+0.5,0.63/d.H. Then, the interval is transformed as 0.5+0.63/2=0.56 using the type-reduction method with the defined split point number according to Equation (9). After that, both d.M and d.H are reduced as 0.56/d.M+0.56/d.H in Figure 6.Definition 8.
The membership degree of a linguistic termRih in the fuzzified dataset D′ is denoted as fviqhc [35] and defined as follows:
(9)fviqhc=fviqhlower+fviqhupper2.Figure 6
Fuzzy compression results from Figure5.


## 4.2. Weighted Sliding Window Model

In this paper, the sliding window model based on the average decay factor (ADF) is applied to construct the WFFPT2-tree of the type-2 fuzzy set [51] to mine the fuzzy frequent patterns (FFPs). The ADF was proposed by Han and Ding [55] for mining the FPs on the transaction data stream, but not for the quantitative data stream. The combination of the sliding window and the ADF not only considers the latest data in a limited time window but also fully considers the influence of historical data. The mining process of the FFPs on the data streams can effectively improve the integrity of the regular patterns. Moreover, the sliding window uses an improved decay factor δ to assign different weights to the new and the old data in different periods. When the data stream continues to arrive, the itemset changes steadily, avoiding the problem of data concepts drifting in the sliding window with the error factor.Based on the continuity of the data stream, the knowledge contained therein will change over time. Usually, the importance or the value of the recent transactions is greater. Therefore, a decay factor is used in this paper to weight the transactions. According to the definition of the decay factorδ, it can be seen that the smaller the value, the less important the corresponding data, and the faster the attenuation. Conversely, the larger the value, the greater the importance and the slower the decay.
(10)δ∈0,1.In the time decay model [58, 59], the data of the sliding window wn has the same decay factor δ. In the sliding window wn, the support value freqP,wn of the item P can be represented as follows:
(11)freqwP,wn=δ,n=1,freqwP,wn−1×δ+r,n≥2,(12)r=1,P∈wn,0,P∉wn.Literature [55] used a time decay model to mine the frequent patterns of the data stream closure through experiments. It is found through experiments that the mode support number after using the decay factor in the time attenuation model is much smaller than the support number without attenuation. If it is performed according to the conventional minimum support, the mining will lose possible frequent patterns. In order to solve this problem, the maximum allowable error factor is ε. In other words, both the FPs and the critical FPs (Definitions 4 and 5) will be saved during the mining process.
(13)freqwP,wn=freqwP,wn−1×δ+r=∑iri×δn−i=r1×δn−1+r2×δn−2+⋯+rm≤δn−1+δn−2+⋯+rm≤11−δ.The decay factor of the sliding windowwi∈w1,w2,⋯,wn is used to divide the value based on the fuzzification process including the three batches Bi, Bi+1, and Bi+2. Each batch contains two itemsets in chronological order in the data stream, and the size of the sliding window can be changed.After determining the minimum support and the maximum allowable error thresholds according to the literature [38], the assumed 100% recall and 100% accuracy rates are used to estimate the decay factor δ. That is, when the recall rate is 100%, Equation (14) is satisfied, which is called the lower limit δrecall. While, when the accuracy rate is 100%, Equation (15) is satisfied as the upper limit δprecision.
(14)δ≥θ−εθ22N−θN−1Recall=100%,(15)δ<θ−εN−1θ−εNPrecision=100%.Since both recall and accuracy cannot be considered at the same time, the choice of decay factor needs to balance the two. Therefore, this article uses the average valueδaverage of the upper and the lower limits as used in the literature [59].
(16)δaverage=δrecall+δprecision2.Definition 9.
The support value of a linguistic term is denoted assupRjh, which is the scalar cardinality of each fuzzy frequent item [35] and is defined as follows:
(17)supRih=∑Rjh⊆Tq∧Tq∈D′fviqhc.According to Definitions4 and 5, when the minimum support θ, the average decay factor δaverage, and the error factor ε are known, the frequent pattern and the critical frequent patterns weighted by the sliding window can be obtained according to Equations (11) and (13), respectively. Then, the patterns are sorted in descending order according to the accumulated count value of the frequent patterns and the critical frequent patterns as shown in Figure 7. Despite the prefuzzification step performed first, the weighted sliding window method will significantly change the count value of the item after multiple iterations due to the variability and the continuous characteristics of the data stream. The FFPs and the critical FFPs are listed in Figure 7. After the weighted sliding window process, there are critical FFPs that reflect the increment part based on the minimum support value designed by the user, which can reduce the concept drift problem.Figure 7
Descending order of frequent pattern and critical frequent patterns.


## 4.3. The Construction-Renew Process of WFFPT2-Tree

This paper uses fuzzy-list sorted structure and WFFPT2-tree to generate fuzzy frequent patterns. The fuzzy-list sorted structure is used to store the attributes of the fuzzy frequent items after the prefuzzification. The attributes of FFIs include the name of the fuzzy frequent item, the count, and the link node. The construction process of WFFPT2-tree consists of adding transactions and deleting the transactions based on the fuzzy-list sorted structure. The proposed WFFPT2-tree is improved from the FP-tree [5]. The WFFPT2-tree with fuzzy-list sorted structure will reduce the memory usage and speed up the mining process.In the WFFPT2-tree structure, each node represents a fuzzified semantic tree transaction, which includes the weighted fuzzified semantic representation of itemsets and the corresponding membership and count values. Since the list is sorted in descending order first, the cache is stored in the form of a queue. Figure8 shows the construction process of the WFFPT2-tree according to Figure 7.Figure 8
WFFPT2-Tree construction process of Transaction T1 to T3.The idea of generating fuzzy pattern trees in descending order adopted in this paper is derived from the tail expansion strategy. This paper adopts the horizontal link to quickly find the corresponding node on the node of the prefix pattern tree. The horizontal link will link the nodes with the same fuzzy linguistic in the descending prefix pattern tree, but the count value will be different, which is convenient for searching and inserting new subtrees or single nodes during the sliding window process.


### 4.3.1. Inserting Phase of the New Tree Transaction

The construction of the WFFPT2-tree is based on the fuzzy-list sorted structure. When the new tree transactionTk generates, it will be added in the tree with the link node and sorted in the fuzzy-list structure. The specific implementation process is as follows. The fuzzy-list sorted structure table contains the frequent and the critical frequent patterns after the weighted sliding window and sorted by the count value as shown in Figure 9.Figure 9
WFFPT2-tree construction result of the sliding windoww1.When the WFFPT2-tree is empty, the first fuzzified transactionT1 through the weighted sliding window contains three fuzzy frequent items T1:0.13/b.M:1+1/b.L:1+0.56/d.M:1, which are inserted into the root header in descending order. When the T2 comes, the descending subtree has the same patterns and then the count increases as shown in Figure 8. When T3 enters, there is no identical node in the current prefix pattern tree, so a new subtree is established. Figure 8 shows the detailed process of adding new branches to the fuzzy frequent pattern tree.A similar process can be obtained whenT4, T5, and T6 are added to WFFPT2-tree in Figure 9. Figure 9 shows the sorted list structure of all items in the sliding window w1, including the fuzzy semantic names, the decay factor, and the link node.


### 4.3.2. Deleting Phase of the Old Tree Transaction

This operation occurs during the sliding phase of the weighted sliding window over the data stream. For example, after the establishment of tree transactions ofw1 shown in Figure 9, the fuzzy frequent transactions enter from w1 to w2 stage, which should be adding to the WFFPT2-tree shown in blue in Figure 10 and the old tree transactions should be deleted shown in red in Figure 10. First, pop a piece of data from the front of the fuzzy-list sorted structure table, and use the pointer to point to the end of the tree transaction in the WFFPT2-tree to find the transaction which needs to be deleted in the tree. Then, from the tail of the WFFPT2-tree to the root, update the count value of the node along the path. It can be seen from the path that the red part whose weighted count value does not meet the minimum support needs to be deleted from the tree. Usually, their horizontal links are also deleted at the same time.Figure 10
WFFPT2-tree construction process of the sliding window fromw1 to w2.Figure10 shows the new node in the sliding window in blue and the results of the deletion. Figure 11 shows the current WFFPT2-tree of the sliding window w2 after deleting the node. Figures 12 and 13 show the processes of adding and deleting after the sliding window w3 has passed, respectively. Figures 8–13 show the example of WSWFFP-T2 algorithm and illustrate the entire process of the sliding window based on the fuzzy-list sorted structure in the proposed algorithm, including the processes of construction and adding and deleting the fuzzy node.Figure 11
WFFPT2-tree construction result of the sliding windoww2.Figure 12
WFFPT2-tree construction process of the sliding window fromw2 to w3.Figure 13
WFFPT2-tree construction result of the sliding windoww3.


### 4.3.3. FFPs Mining Phase

The mining process of frequent patterns is performed by querying the mining results of the current window. In the WFFPT2-tree, all frequent patterns can be mined through recursion to facilitate the finding of the entire WFFPT2-tree, and the patterns with support greater than the threshold are frequent patterns. Although the WSWFFP-T2 algorithm proposed in this paper mines frequent patterns with a fixed window size, the processes of inserting the new nodes and deleting the nodes in the algorithm are independent of each other. Thus, increasing and reducing the number of sliding windows will not affect the correctness of the algorithm. This part is also tested and verified in subsequent experiments. The algorithm can easily be applied to the variable-length sliding window model.


### 4.3.4. The Pseudocode of the Proposed WFFPT2-Tree Algorithm

Algorithm 1: WFFPT2-tree algorithm.
Input:Int SizeP//the size of BatchInt Sizew//the size of the windowDouble minsup //the minimum support valueList ItemTalbe//the fuzzy-list sorted-structure tableList InstanceList//the storage table of InstanceArffFIleStream Arff//Arff data streamOutput:FFPsMain(){//main function1 Arff.LoadArffFIle();//Read in data stream and fuzzify linguistic data based on type 2 fuzzification method2  CreateWFFPWindow();//Create the weighted sliding window3  While(Arff.hasInstance!=nul)//Read data stream4   {5    Instance=LoadNextInstance();//read the next instance6    FuzzySetCompute(instace);//Calculate the membership degree of type 2 fuzzy set by formula7    Compress(Tmp);//Compression of the fuzzy calculation result; ;8    UpdateWFFPWindows();//update the weighted fuzzy frequent window9   }10  OutputFFPT2(minsup); //Output fuzzy frequent patterns meeting the minimum support degree;11  }Sub Algorithm1: CreateWFFPWindow1 CreateWFFPWindow(){2  Times=0;3  While(Times<SizeW){4  Instance=Arff.nextInstace();//Read according to the window size5  UpdateItem(Instance); //Update Item table6  InstanceList.add(Instance);7  }8  //ItemTable sorts itself first, and obtains the path Order according to the Count in the Item table9  ItemTable.sort();10  Getorder();11  InstanceList.SortByOrder();//Sort the instances in Oder order12  CreateTree(InstanceLIst);//Insert the instance into the tree13  }Sub Algorithm 2: FuzzySetCompute1  FuzzySetCompute(instance){2  //Calculate F.lower() and F.upper() according to the model3  Tmp.add(F.lower(),F.upper());4  }Sub Algorithm 3: UpdateWFFPWindows1  UpdateWFFPWindows{      //Update window2  DelTree();  //Same as createwindow(), delete the old pane instance from the tree3 }Sub Algorithm 4: OutputFFPs1  OutputPPFs(minsup){2  //caculate the Sup(Item) from ItemTable3  If sup(item)>minsup{4  //output the results through the corresponding Item.Link5  OutputFromLink(item);6  }}


## 4.3.1. Inserting Phase of the New Tree Transaction

The construction of the WFFPT2-tree is based on the fuzzy-list sorted structure. When the new tree transactionTk generates, it will be added in the tree with the link node and sorted in the fuzzy-list structure. The specific implementation process is as follows. The fuzzy-list sorted structure table contains the frequent and the critical frequent patterns after the weighted sliding window and sorted by the count value as shown in Figure 9.Figure 9
WFFPT2-tree construction result of the sliding windoww1.When the WFFPT2-tree is empty, the first fuzzified transactionT1 through the weighted sliding window contains three fuzzy frequent items T1:0.13/b.M:1+1/b.L:1+0.56/d.M:1, which are inserted into the root header in descending order. When the T2 comes, the descending subtree has the same patterns and then the count increases as shown in Figure 8. When T3 enters, there is no identical node in the current prefix pattern tree, so a new subtree is established. Figure 8 shows the detailed process of adding new branches to the fuzzy frequent pattern tree.A similar process can be obtained whenT4, T5, and T6 are added to WFFPT2-tree in Figure 9. Figure 9 shows the sorted list structure of all items in the sliding window w1, including the fuzzy semantic names, the decay factor, and the link node.


## 4.3.2. Deleting Phase of the Old Tree Transaction

This operation occurs during the sliding phase of the weighted sliding window over the data stream. For example, after the establishment of tree transactions ofw1 shown in Figure 9, the fuzzy frequent transactions enter from w1 to w2 stage, which should be adding to the WFFPT2-tree shown in blue in Figure 10 and the old tree transactions should be deleted shown in red in Figure 10. First, pop a piece of data from the front of the fuzzy-list sorted structure table, and use the pointer to point to the end of the tree transaction in the WFFPT2-tree to find the transaction which needs to be deleted in the tree. Then, from the tail of the WFFPT2-tree to the root, update the count value of the node along the path. It can be seen from the path that the red part whose weighted count value does not meet the minimum support needs to be deleted from the tree. Usually, their horizontal links are also deleted at the same time.Figure 10
WFFPT2-tree construction process of the sliding window fromw1 to w2.Figure10 shows the new node in the sliding window in blue and the results of the deletion. Figure 11 shows the current WFFPT2-tree of the sliding window w2 after deleting the node. Figures 12 and 13 show the processes of adding and deleting after the sliding window w3 has passed, respectively. Figures 8–13 show the example of WSWFFP-T2 algorithm and illustrate the entire process of the sliding window based on the fuzzy-list sorted structure in the proposed algorithm, including the processes of construction and adding and deleting the fuzzy node.Figure 11
WFFPT2-tree construction result of the sliding windoww2.Figure 12
WFFPT2-tree construction process of the sliding window fromw2 to w3.Figure 13
WFFPT2-tree construction result of the sliding windoww3.


## 4.3.3. FFPs Mining Phase

The mining process of frequent patterns is performed by querying the mining results of the current window. In the WFFPT2-tree, all frequent patterns can be mined through recursion to facilitate the finding of the entire WFFPT2-tree, and the patterns with support greater than the threshold are frequent patterns. Although the WSWFFP-T2 algorithm proposed in this paper mines frequent patterns with a fixed window size, the processes of inserting the new nodes and deleting the nodes in the algorithm are independent of each other. Thus, increasing and reducing the number of sliding windows will not affect the correctness of the algorithm. This part is also tested and verified in subsequent experiments. The algorithm can easily be applied to the variable-length sliding window model.


## 4.3.4. The Pseudocode of the Proposed WFFPT2-Tree Algorithm

Algorithm 1: WFFPT2-tree algorithm.
Input:Int SizeP//the size of BatchInt Sizew//the size of the windowDouble minsup //the minimum support valueList ItemTalbe//the fuzzy-list sorted-structure tableList InstanceList//the storage table of InstanceArffFIleStream Arff//Arff data streamOutput:FFPsMain(){//main function1 Arff.LoadArffFIle();//Read in data stream and fuzzify linguistic data based on type 2 fuzzification method2  CreateWFFPWindow();//Create the weighted sliding window3  While(Arff.hasInstance!=nul)//Read data stream4   {5    Instance=LoadNextInstance();//read the next instance6    FuzzySetCompute(instace);//Calculate the membership degree of type 2 fuzzy set by formula7    Compress(Tmp);//Compression of the fuzzy calculation result; ;8    UpdateWFFPWindows();//update the weighted fuzzy frequent window9   }10  OutputFFPT2(minsup); //Output fuzzy frequent patterns meeting the minimum support degree;11  }Sub Algorithm1: CreateWFFPWindow1 CreateWFFPWindow(){2  Times=0;3  While(Times<SizeW){4  Instance=Arff.nextInstace();//Read according to the window size5  UpdateItem(Instance); //Update Item table6  InstanceList.add(Instance);7  }8  //ItemTable sorts itself first, and obtains the path Order according to the Count in the Item table9  ItemTable.sort();10  Getorder();11  InstanceList.SortByOrder();//Sort the instances in Oder order12  CreateTree(InstanceLIst);//Insert the instance into the tree13  }Sub Algorithm 2: FuzzySetCompute1  FuzzySetCompute(instance){2  //Calculate F.lower() and F.upper() according to the model3  Tmp.add(F.lower(),F.upper());4  }Sub Algorithm 3: UpdateWFFPWindows1  UpdateWFFPWindows{      //Update window2  DelTree();  //Same as createwindow(), delete the old pane instance from the tree3 }Sub Algorithm 4: OutputFFPs1  OutputPPFs(minsup){2  //caculate the Sup(Item) from ItemTable3  If sup(item)>minsup{4  //output the results through the corresponding Item.Link5  OutputFromLink(item);6  }}


## 5. Experimental Study

### 5.1. Experimental Environment and Data Stream

This section presents the experimental results and the performance analysis of the WSWFFP-T2 algorithm. All the experiments are performed on Windows 10/64-bit system, which is configured as Intel Premium, and all algorithms are implemented in Java (IntelliJ IDEA 2019.3.3 x64) [60]. The data stream studied in this article is the real artificial data stream of the breast.w.arff (Wisconsin Prognostic Breast Cancer Database) to support the findings of this study.The dataset contains 10 attributes: Clump_Thickness numeric, Cell_Size_Uniformity numeric, Cell_Shape_Uniformity numeric, Marginal_Adhesion numeric, Single_Epi_Cell_Size numeric, Single_Epi_Cell_Size numeric, Bare_Nuclei numeric, Bland_Chromatin numeric, Normal_Nucleoli numeric, Mitoses numeric, and Class {benign,malignant}. The benign and malignant give the results of the breast cancer. The data of the attributes are integer [1, 10].


### 5.2. Performance Analysis

Figures14 and 15 show the time and the memory consumption of the proposed algorithm on the breast cancer database, which is generated as a data stream. The number of the transactions is 64000. During the memory consumption and the running time, the window size gradually expands from 4 to 250. It can be seen from Figure 14 that as the window increases during the operation of the algorithm, the time consumption changes within a certain interval, but the overall trend is stable. The reason is to maintain a record of all tree transactions in the sliding window. The algorithm needs to add the newly added sliding window list and delete the list of nodes that are not in the window of the tree transaction. Since the length of the transaction itemset in the data stream is uncertain, it will bring time in the obfuscation process. Uncertainty is caused by the characteristics of the data in the data stream. At the same time, the first step in the calculation of the algorithm is to perform type-2 fuzzification on the digital data stream. This will also increase the number of nodes that need to be processed and increase the time overhead of the algorithm. However, the overall running time is stable and concentrated within an acceptable range.Figure 14
Running time based on variable sliding window.Figure 15
Memory based on variable sliding window.Figure15 shows that the memory increases with the continuous increase of the window size, which indicates that the tree transaction and the data in the list structure to be processed are increased with the increase in the sliding window. After the transactions in the sliding window are fuzzified, the fuzzification results increase the number of original transactions in a linear relationship of k times. Therefore, it can be seen that the window and memory consumption increase in a linear manner. The problem of excessive memory consumption can be avoided by reasonably selecting the appropriate sliding window for the data stream. The authors will continue to study how to dynamically adjust the sliding window for the data stream.The above experimental analysis shows that the sliding window continues to increase, and the memory consumption of the algorithm increases linearly. Further experiments are conducted to verify the relationship between the number of transactions and memory and the operating consumption when the sliding window is fixed. Figures16 and 17 show the relationship between running time and transaction volume when the sliding window is fixed at 4 and the number of transactions continues to increase.Figure 16
Running time based on transactions.Figure 17
Memory consumption based on transactions.As can be seen from Figure16 that running time continues to increase, as the volume of the transactions increases. This is because the volume of the transactions that need to be processed increases, and the sliding window needs to be fixed. After the algorithm needs to update the fading factor of each sliding window, the time of transaction obfuscation also increases. The other reason is that the more the transaction volume, the longer the running time. Figure 17 shows that under the same sliding window, the memory consumption tends to be stable as the transaction volume increases. During the creation of the sliding window, as the window continues to move, new data is added to the list and the tree is created. When the sliding window is across the data stream, the nodes that are not in the current window need to be clear from the list structure, and the input and the output operation brought about makes the memory consumption fluctuate. However, because the amount of data in the sliding window tends to be stable during the Java programming process, the memory consumption of the algorithm operation tends to change steadily within a specific time interval. It is also the benefit of the sliding windows, and the memory consumption of the algorithms without sliding windows will continue to increase because the release speed is relatively slow.In order to further analyze the performance of the algorithm proposed in this paper, Table1 shows the running time test of each function of the proposed algorithm in this paper when the number of transactions is fixed at 64000. The tested parameters include the ratio of the time taken by the node to be deleted, the ratio of the time required to obscure the data stream, the ratio of time to update the node, the ratio of time to delete the node, and the ratio of other times in the operation.Table 1
Percentage of running time of each module of WSWFFPs-T2 algorithm.
Read dataFuzzy processRenew nodeDelete nodeOthersWindow sizesItem numbers17.8%44.4%1.8%2.2%33.8%46400017.0%40.9%2.9%3.0%36.2%86400022.8%36.0%5.7%7.7%27.8%166400020.6%22.6%3.8%6.6%46.4%326400025.0%18.3%7.0%6.1%43.6%646400023.0%28.4%3.3%5.1%40.2%1286400015.9%17.9%2.8%9.2%54.2%25664000Figure18 shows that when the number of transactions is fixed at 64000, the size of the sliding window increases from 4 to 128 and the time proportions of each part of the algorithm are tested as follows. Figures 18(a)–18(f) show that the operation time of reading the data increases from 17.8% to 23%, the fuzzification process is reduced from 44.4% to 28%, updating the nodes is increased from 1.8% to 3.3%, deleting the nodes is increased from 2.2% to 5.7%, and the other operations varied from 27.8% to 46.45%. Figure 19 shows an average time distribution of each part. In the process of selecting the size of the sliding window, an appropriate size of the sliding window can be selected as a reference to Figures 18(a)–18(f) given in the experiments.Figure 18
The running time ratio of each part of the algorithm based on different window sizes.
(a)
Windowsize=4(b)
Windowsize=8(c)
Windowsize=16(d)
Windowsize=32(e)
Windowsize=64(f)
Windowsize=128Figure 19
The average running time ratio of each part of the algorithm based on different window sizes.In the overall operation of the algorithm proposed in this paper, the time consumption is mainly concentrated in the data reading and fuzzification process, because when the window is fixed, updating and deleting the nodes in the construction of lists and trees are relatively small and not more than 10%.


### 5.3. Results and Comparisons

In the experiments, the database is tested according to the predefined membership and support with different numbers of transactions. In literature [35], the LFFP algorithm outperforms the Apriori algorithm; thus, it is unnecessary to conduct the performance of the Apriori algorithm in our experiments. The execution time of sup=0.1 of FPGrowth_itemsets algorithm consumes more time than sup=0.4. For the FPGrowth_itemsets algorithm is not adapted to the data stream, the authors do the experiment at the same number of transaction with sliding window.From Figure20, it can be observed that the execution time of the proposed algorithm is longer than the FPGrowth_itemsets algorithm but in an acceptable scale. The first reason is that the proposed algorithm of fuzzification process is based on the type-2 fuzzy set theory generating numbers of fuzzy nodes including the frequent patterns and the critical frequent patterns shown in Figures 18(a)–18(f). The second reason is that the input and output data operation and fuzzification processes consume nearly 50% of the whole algorithm from the experimental results in Figure 19. But the proposed algorithm can provide linguistic frequent pattern over the data streams that the people can understand the results meaning without the help of experts. The other one is the proposed algorithm which uses the precision and recall rates to avoid the concept drift during the data stream mining process.Figure 20
Execution time of the compared algorithms.It can be observed from Figure21 that the proposed WSWFFP-T2 algorithm generally has little memory consumption than the FPGrowth_itemsets algorithm at the same support with different numbers of transactions. As the number of transactions increases, the memory consumption of FPGrowth_itemsets algorithm is linearly increasing with the number of transactions. The proposed algorithm has stable memory consumption at a lower level.Figure 21
Memory consumption of the compared algorithms.Based on the above observations, it can be concluded that the proposed WSWFFP-T2 algorithm with one scan can mine with varied weighted sliding window to mine MFFIs over the data stream with efficiency and high performance compared with the other related algorithms.


## 5.1. Experimental Environment and Data Stream

This section presents the experimental results and the performance analysis of the WSWFFP-T2 algorithm. All the experiments are performed on Windows 10/64-bit system, which is configured as Intel Premium, and all algorithms are implemented in Java (IntelliJ IDEA 2019.3.3 x64) [60]. The data stream studied in this article is the real artificial data stream of the breast.w.arff (Wisconsin Prognostic Breast Cancer Database) to support the findings of this study.The dataset contains 10 attributes: Clump_Thickness numeric, Cell_Size_Uniformity numeric, Cell_Shape_Uniformity numeric, Marginal_Adhesion numeric, Single_Epi_Cell_Size numeric, Single_Epi_Cell_Size numeric, Bare_Nuclei numeric, Bland_Chromatin numeric, Normal_Nucleoli numeric, Mitoses numeric, and Class {benign,malignant}. The benign and malignant give the results of the breast cancer. The data of the attributes are integer [1, 10].


## 5.2. Performance Analysis

Figures14 and 15 show the time and the memory consumption of the proposed algorithm on the breast cancer database, which is generated as a data stream. The number of the transactions is 64000. During the memory consumption and the running time, the window size gradually expands from 4 to 250. It can be seen from Figure 14 that as the window increases during the operation of the algorithm, the time consumption changes within a certain interval, but the overall trend is stable. The reason is to maintain a record of all tree transactions in the sliding window. The algorithm needs to add the newly added sliding window list and delete the list of nodes that are not in the window of the tree transaction. Since the length of the transaction itemset in the data stream is uncertain, it will bring time in the obfuscation process. Uncertainty is caused by the characteristics of the data in the data stream. At the same time, the first step in the calculation of the algorithm is to perform type-2 fuzzification on the digital data stream. This will also increase the number of nodes that need to be processed and increase the time overhead of the algorithm. However, the overall running time is stable and concentrated within an acceptable range.Figure 14
Running time based on variable sliding window.Figure 15
Memory based on variable sliding window.Figure15 shows that the memory increases with the continuous increase of the window size, which indicates that the tree transaction and the data in the list structure to be processed are increased with the increase in the sliding window. After the transactions in the sliding window are fuzzified, the fuzzification results increase the number of original transactions in a linear relationship of k times. Therefore, it can be seen that the window and memory consumption increase in a linear manner. The problem of excessive memory consumption can be avoided by reasonably selecting the appropriate sliding window for the data stream. The authors will continue to study how to dynamically adjust the sliding window for the data stream.The above experimental analysis shows that the sliding window continues to increase, and the memory consumption of the algorithm increases linearly. Further experiments are conducted to verify the relationship between the number of transactions and memory and the operating consumption when the sliding window is fixed. Figures16 and 17 show the relationship between running time and transaction volume when the sliding window is fixed at 4 and the number of transactions continues to increase.Figure 16
Running time based on transactions.Figure 17
Memory consumption based on transactions.As can be seen from Figure16 that running time continues to increase, as the volume of the transactions increases. This is because the volume of the transactions that need to be processed increases, and the sliding window needs to be fixed. After the algorithm needs to update the fading factor of each sliding window, the time of transaction obfuscation also increases. The other reason is that the more the transaction volume, the longer the running time. Figure 17 shows that under the same sliding window, the memory consumption tends to be stable as the transaction volume increases. During the creation of the sliding window, as the window continues to move, new data is added to the list and the tree is created. When the sliding window is across the data stream, the nodes that are not in the current window need to be clear from the list structure, and the input and the output operation brought about makes the memory consumption fluctuate. However, because the amount of data in the sliding window tends to be stable during the Java programming process, the memory consumption of the algorithm operation tends to change steadily within a specific time interval. It is also the benefit of the sliding windows, and the memory consumption of the algorithms without sliding windows will continue to increase because the release speed is relatively slow.In order to further analyze the performance of the algorithm proposed in this paper, Table1 shows the running time test of each function of the proposed algorithm in this paper when the number of transactions is fixed at 64000. The tested parameters include the ratio of the time taken by the node to be deleted, the ratio of the time required to obscure the data stream, the ratio of time to update the node, the ratio of time to delete the node, and the ratio of other times in the operation.Table 1
Percentage of running time of each module of WSWFFPs-T2 algorithm.
Read dataFuzzy processRenew nodeDelete nodeOthersWindow sizesItem numbers17.8%44.4%1.8%2.2%33.8%46400017.0%40.9%2.9%3.0%36.2%86400022.8%36.0%5.7%7.7%27.8%166400020.6%22.6%3.8%6.6%46.4%326400025.0%18.3%7.0%6.1%43.6%646400023.0%28.4%3.3%5.1%40.2%1286400015.9%17.9%2.8%9.2%54.2%25664000Figure18 shows that when the number of transactions is fixed at 64000, the size of the sliding window increases from 4 to 128 and the time proportions of each part of the algorithm are tested as follows. Figures 18(a)–18(f) show that the operation time of reading the data increases from 17.8% to 23%, the fuzzification process is reduced from 44.4% to 28%, updating the nodes is increased from 1.8% to 3.3%, deleting the nodes is increased from 2.2% to 5.7%, and the other operations varied from 27.8% to 46.45%. Figure 19 shows an average time distribution of each part. In the process of selecting the size of the sliding window, an appropriate size of the sliding window can be selected as a reference to Figures 18(a)–18(f) given in the experiments.Figure 18
The running time ratio of each part of the algorithm based on different window sizes.
(a)
Windowsize=4(b)
Windowsize=8(c)
Windowsize=16(d)
Windowsize=32(e)
Windowsize=64(f)
Windowsize=128Figure 19
The average running time ratio of each part of the algorithm based on different window sizes.In the overall operation of the algorithm proposed in this paper, the time consumption is mainly concentrated in the data reading and fuzzification process, because when the window is fixed, updating and deleting the nodes in the construction of lists and trees are relatively small and not more than 10%.


## 5.3. Results and Comparisons

In the experiments, the database is tested according to the predefined membership and support with different numbers of transactions. In literature [35], the LFFP algorithm outperforms the Apriori algorithm; thus, it is unnecessary to conduct the performance of the Apriori algorithm in our experiments. The execution time of sup=0.1 of FPGrowth_itemsets algorithm consumes more time than sup=0.4. For the FPGrowth_itemsets algorithm is not adapted to the data stream, the authors do the experiment at the same number of transaction with sliding window.From Figure20, it can be observed that the execution time of the proposed algorithm is longer than the FPGrowth_itemsets algorithm but in an acceptable scale. The first reason is that the proposed algorithm of fuzzification process is based on the type-2 fuzzy set theory generating numbers of fuzzy nodes including the frequent patterns and the critical frequent patterns shown in Figures 18(a)–18(f). The second reason is that the input and output data operation and fuzzification processes consume nearly 50% of the whole algorithm from the experimental results in Figure 19. But the proposed algorithm can provide linguistic frequent pattern over the data streams that the people can understand the results meaning without the help of experts. The other one is the proposed algorithm which uses the precision and recall rates to avoid the concept drift during the data stream mining process.Figure 20
Execution time of the compared algorithms.It can be observed from Figure21 that the proposed WSWFFP-T2 algorithm generally has little memory consumption than the FPGrowth_itemsets algorithm at the same support with different numbers of transactions. As the number of transactions increases, the memory consumption of FPGrowth_itemsets algorithm is linearly increasing with the number of transactions. The proposed algorithm has stable memory consumption at a lower level.Figure 21
Memory consumption of the compared algorithms.Based on the above observations, it can be concluded that the proposed WSWFFP-T2 algorithm with one scan can mine with varied weighted sliding window to mine MFFIs over the data stream with efficiency and high performance compared with the other related algorithms.


## 6. Conclusion

In this paper, an efficient fuzzy-list sorted structure and WSWFFP-T2 tree are presented to keep the necessary fuzzy information for mining the MFFIs based on the artificial datasets of medical data stream. The weighted sliding window and the construction strategy of fuzzy frequent pattern tree are designed to adapt to the real-time data stream and also to reduce memory consumption in mining the MFFIs. The precision and recall factors are designed to ensure the accuracy of the proposed algorithm. The experimental results and comparative analysis demonstrate that the proposed algorithm outperforms the classical and the latest algorithms over the quantitative data stream in the real-time medical data stream.



---

*Source: 6662254-2021-12-26.xml*