Energy and Entropy Measures of Fuzzy Relations for Data Analysis

We present a new method for assessing the strength of fuzzy rules with respect to a dataset, based on the measures of the greatest energy and smallest entropy of a fuzzy relation. Considering a fuzzy automaton (relation), in which A is the input fuzzy set and B the output fuzzy set, the fuzzy relation R1 with greatest energy provides information about the greatest strength of the input-output, and the fuzzy relation R2 with the smallest entropy provides information about uncertainty of the input-output relationship. We consider a new index of the fuzziness of the input-output based on R1 and R2. In our method, this index is calculated for each pair of input and output fuzzy sets in a fuzzy rule. A threshold value is set in order to choose the most relevant fuzzy rules with respect to the data.


Introduction
Let X = {x 1 , . . . , x m } be a finite set and A be a fuzzy set of X. In [1,2] two categories of fuzziness, measures are defined as energy and entropy (see, e.g., also [3]). The energy measure of the fuzziness of A is given by: where e: [0,1] → [0,1] is a monotonically increasing continuous function, with e(0) = 0 and e(1) = 1. A particular energy function is given by e(u) = u for any u ∈ [0,1]. In this case, the minimum value of the energy is 0, and the maximum is given by E(A) = Card(X) = m. The entropy measure of fuzziness of the fuzzy set A is defined as: where h: [0,1] → [0,1] is a monotonically increasing continuous function in [0, 1 2 ] and monotonically decreasing in [ 1 2 , 1], with h(0) = h(1) = 0 and h(u) = h(1 − u). A simple entropy function is given by h(u) = u if u ≤ 1 2 and h(u) = 1 − u if u > 1 2 . Now we consider another finite set, Y = {y 1 , . . . , y n }, and a fuzzy relation R defined by X × Y: and h(R(x i , y j )) (4) ∨ m i=1 (R(x i , y j )tA(x i ))= B(y j ) j = 1, . . . , n (5) where A (resp., B) is a known input (resp., output) fuzzy set, and R is an n unknown fuzzy automaton (relation) connecting the inputs-output via fuzzy rules. Solutions for the fuzzy relation Equation (5) were proposed in [4][5][6] (see, e.g., [7] if t = min). In particular, if we consider the t-norm of Yager [8], the unique greatest fuzzy relation R 1 is defined as R 1 (x, y) = A(x)τB(y), where τ : [0, 1] × [0, 1] → [0, 1] is given: R 1 is the fuzzy relation having the maximum energy E. Furthermore, in [4,5] the authors propose an algorithm for finding the relation R 2 , solution of (5) not unique, having the minimum entropy H.
Many works in data and decision analysis present methods to minimize the fuzzy entropy for obtaining the solution with the smallest ambiguity. Some research works, such as [9][10][11][12][13][14][15][16][17], present fuzzy decision algorithms for classification analysis using minimum fuzzy entropy.
We propose a new method for measuring the strength of fuzzy rules with respect to a set of input-output data, based on the maximum energy and minimum entropy measures.
Our idea is to calculate, for any pair of input and output fuzzy sets, a normalized index of the strength of the rule with respect to the data, which is a function of the maximum energy and minimum entropy. We find the best input-output fuzzy sets pair to be that for which the corresponding index is maximum. If this index is greater or equal to a pre-defined threshold, then we consider the fuzzy rule which is more relevant with respect to the data.
In Section 2, we describe the algorithm presented in [4,5] for calculating the solutions R 1 and R 2 of the Equation (5) with the Yager t-norm. In Section 3, our algorithm is presented for evaluating the strength of fuzzy rules with respect to the data. In Section 4, we present the results of two experiments in which we apply our algorithm. Final considerations are shown in Section 5.

Evaluating the Strength of the Fuzzy Rules with Respect to the Data
Our goal is to evaluate the strength of the fuzzy rules considered in a domain's expert with respect to dataset [18]. Transferring its knowledge of the domain, the expert builds a fuzzy partition of q fuzzy sets {A 1 , . . . , A q } of the universe of the discourse U x of the input variable x, and a fuzzy partition of s fuzzy sets {B 1 , . . . , B s } of the universe of the discourse U y of the output variable y. Subsequently, he defines a set of fuzzy rules relating the input and the output variables in the following form: rk: if x is A w Then y is B z , w = 1, . . . , q, z = 1, . . . , s where rk is the kth fuzzy rule of the fuzzy rule set. For instance, let a dataset be composed by m measures of the input variable x, X = {x 1 , . . . , x m }, and a dataset composed by n measures of the output variable y, Y = {y 1 , . . . , y n }. For each rule we extract the pair (A w ,B z ) formed by the input and the output fuzzy sets in (7), and we calculate a normalized index based on the maximum energy and minimum entropy. The index represents the strength of the kth fuzzy rule with respect to the data. Let R be the fuzzy automaton (relation) connecting A w and B z by means of Equation (5) with the Yager t-norm. Let R 1wz and R 2wz serve as the solutions of (5), with maximum energy and minimum entropy calculated using the algorithms of Section 2. The index of strength for the pair (A w ,B z ) is defined [4] as: For I wz = 1, we obtain E(R 1wz ) = n·m and H(R 2wz ) = 0. If I wz is greater or equal to a pre-defined threshold, then the fuzzy rule is confirmed by the data. In Figure 1, this process is schematized. Below we show the pseudocode of the algorithm (Algorithm 3).

Algorithm 3 Energy-Entropy fuzzy rules evaluation Description:
Calculate the matrix R2 Input: X, Y, A, B Output: SET Ith // set the threshold value 2 FOR k = 1 TO D // for all the D fuzzy rules in the dataset 2 { 3 Imin: = 2; // Imin is initialized to a value greater than 1 4 Create the fuzzy subsets Bz(y1),…, Bz(yn); Create the fuzzy subsets A (l) wl(x1),…, A (l) wl(xm); 8 Calculate R1and R2; 9 Calculate E and H; 10 Calculate I; The continuous black arrows are related to two processes: the red arrows symbolize the use of data in input and the black arrows symbolize the use of data in output.
In the first phase, the expert creates the fuzzy partition for U x and U y and creates the fuzzy rule set. Then, the expert analyzes each fuzzy rule with respect to a set of data. For the input-output pair (A w ,B z ), A w (x 1 ), . . . , A w (x m ), B z (y 1 ), . . . , B z (y n ), the fuzzy relations R 1 and R 2 , the Energy E, the Entropy H, and the index I are calculated. If the index I is greater or equal to a prefixed threshold, Entropy 2018, 20, 424 5 of 12 then the rule is considered to be significant to the fuzzy rule set with respect to the input/output data. We can generalize this model to the case in which two or more input variables are considered. The generalized form of a fuzzy rule is given by the form: where A (1) wl , l = 1, . . . , v, is a fuzzy set of the fuzzy partition of the universe of the discourse of the input variable.
wv , B z ), we calculate the corresponding indices I (l) w l z for l = 1, . . . , v and assign a measure of strength of the fuzzy rule with respect to the data given by: Below we show the pseudocode of the algorithm (Algorithm 3).

END
The threshold value I th can be settled by the expert by using an opportune calibration. This calibration can be obtained by testing the algorithm applied on a sample dataset for which the expert can evaluate the strength of fuzzy rules with respect to the data. In Section 4, we present some results obtained by using various datasets. The first experiment is used for calibrating the threshold value I th . Obviously the computational time is polynomial, being given by O(n·m·v).

Test Results
Here we use e(u) = u for u ∈ [0,1] and, in accordance with [2,3], the following fuzzy entropy: and the Equation (5) with the Yager t-norm. The city of Naples is partitioned into 10 municipalities. In turn, each municipality includes a set of districts, as listed in Table 1. In the first experiment, we consider the input x = Percentage of inhabitants with less than 5 years old and the output y = Number of public kindergartens. The data extracted are shown in Table 2. The fuzzy partitions are composed by fuzzy numbers given by semi-trapezoidal or triangular fuzzy sets [19]. The first and last fuzzy sets are semi-trapezoidal, and the intermediate fuzzy sets are triangular. The triangular fuzzy numbers are represented with three number, as A = (a 1 ,a 2 ,a 3 ) and B = (b 1 ,b 2 ,b 3 ). In Table 3 we show the four fuzzy sets forming the fuzzy partition of the domain U x . In Table 4 we show the five fuzzy sets forming the fuzzy partition of the domain U y .   10 12 In Figures 2 and 3 we show the graphs of the fuzzy sets of the fuzzy partitions for the domains U x and U y , respectively. Label a1 a2 a3 low 0 2 4 adequate 2 4 5 fair 4 5 6 high 5 6 8 In Table 4 we show the five fuzzy sets forming the fuzzy partition of the domain Uy.  10 12 In Figures 2 and 3 we show the graphs of the fuzzy sets of the fuzzy partitions for the domains Ux and Uy, respectively.   Label a1 a2 a3 low 0 2 4 adequate 2 4 5 fair 4 5 6 high 5 6 8 In Table 4 we show the five fuzzy sets forming the fuzzy partition of the domain Uy.  10 12 In Figures 2 and 3 we show the graphs of the fuzzy sets of the fuzzy partitions for the domains Ux and Uy, respectively.    Table 5 (resp., Table 6) shows E, H, I, corresponding to the three rules for p = 1 (resp., p = 2). For calibrating the threshold value for the index I, after extracting the data x and y, the expert analyzes how each fuzzy rule appears consistent with respect to the data, i.e., which the degree of the fuzzy rule is confirmed from the data. He considers Rule 1 completely consistent with the data, and Rule 2 sufficiently consistent; therefore, Rule 3 is not sufficiently consistent with the data. For this reason, we set the threshold value to less or equal to the strength index I calculated for Rule 2. This value is 0.79 for p = 1 and 0.71 for p = 2. Then we set p = 2 and I th = 0.7 in all the experiments.
Below we present the results of the second experiment in which two input variables are considered. The inputs are the following: x 1 = Percentage of families in residential properties with respect to the total resident families and x 2 = Percentage of graduates with respect to the total workforce. The output is y = Unemployment rate.
In Table 7, we show the data extracted for the 10 municipalities. In Tables 8-10, we show the fuzzy sets forming the fuzzy partitions of the domain U x1 , U x2 , U y , respectively.          The results in Table 11 show that the final indices of the fuzzy rules are greater than the threshold Ith = 0.7, except for the fuzzy rules 1 and 2.  Table 11, we show the value of the index I calculated for any fuzzy rule (column I rule), when p = 2. For each pair (A (1) w , B z ) and (A (2) w , B z ) in the rule, we show the values of E, H, I. The results in Table 11 show that the final indices of the fuzzy rules are greater than the threshold I th = 0.7, except for the fuzzy rules 1 and 2.

Conclusions
We present a new method that uses fuzzy energy and fuzzy entropy to evaluate the strength of fuzzy rules set by an expert, with respect to a set of data. We correlate the input and the output data via Equation (5), where t is the Yager t-norm, and calculate the corresponding relations which are solutions of (5) with maximum energy and minimum entropy.
After the processes of the creation of the fuzzy partitions of the input and output variable domains, and of the significant fuzzy rule set by the expert, a normalized index of the strength of each fuzzy rule with respect to the data is measured.
If this index is greater than a calibrated threshold, then the fuzzy rule is considered significant with respect to the data. We extend this approach to fuzzy rules in which there are two or more input variables. In this case, we calculate the index of strength separately for each pair of input and output, and we assign a best index of strength to the rule(s) having the minimum value of these indices. The results of some experiments are presented in order to show how our algorithm works inside a fuzzy rule set.