A Method Based on Extended Fuzzy Transforms to Approximate Fuzzy Numbers in Mamdani Fuzzy Rule-Based System

. We propose a new Mamdani fuzzy rule-based system in which the fuzzy sets in the antecedents and consequents are assigned in a discrete set of points and approximated by using the extended inverse fuzzy transforms, whose components are calculated by verifying that the dataset is sufficiently dense with respect to the uniform fuzzy partition. We test our system in the problem of spatial analysis consisting in the evaluation of the livability of residential housings in all the municipalities of the district of Naples (Italy). Comparisons are done with the results obtained by using trapezoidal fuzzy numbers in the fuzzy rules.


Introduction
A fuzzy number (FN) is a fuzzy set with membership function A: Reals → [0, 1] defined as Complicated left-side and right-side functions can generate serious computational difficulties when imprecise information is modeled by FNs.In order to overcome this problem, the original FN can be approximated with other easier functions.The simplest FNs used in fuzzy modeling, fuzzy control, and fuzzy decision-making are the trapezoidal and triangular FNs.In a trapezoidal FN the functions A − and A + are linear; for instance, A − (x) = (x-a)/(c-a) and A + (x) = (b-x)/(b-d) with a≤b≤c≤d, a ̸ =c, b ̸ =d.In a triangular FN it is assumed that d=c.Other simple FNs widely used are the degenerated left (resp., right) size semitrapezoidal FNs with a = c < d < b (resp., a < c < d = b).In many problems trapezoidal, triangular, or semitrapezoidal approximations of FNs could give a loss of information not negligible and this can significantly affect the reliability of the results.
Furthermore, the membership functions of FNs used in applications are not generally known, for example, when they are obtained as relative frequencies of measured occurrences in a discrete set of points or in collaborative applications in which a set of stakeholders evaluate separately the membership degrees of a FN and the function is assigned as an average of these membership degrees.For making understandable this idea, in the example of Figure 1, the membership degree (T) of the fuzzy set "daily temperature T" (measured in ∘ C) for a discrete set of 100 points is the average of the membership degrees evaluated separately by many stakeholders.
Recently many methods are proposed in order to approximate FNs with easier FNs using a suitable metric (see, e.g., [1][2][3][4][5][6]).Some authors investigate approximations by adding some restrictions to preserve properties of a FN as core [7], ambiguity [8][9][10], expected interval, translation invariance, and scale invariance [11,12].As pointed out in [13], by 2 Advances in Fuzzy Systems (1) nfln 0 (2) Create the fuzzy partition (3) Calculate the direct F-transform components (4) WHILE the dataset is sufficiently dense with respect to the fuzzy partition (5) Calculate the approximation error (6) IF (approximation error ≤ threshold) THEN (7) Store the direct F-transform components (8) RETURN "SUCCESS" (9) END IF (10) nfln+1 (11) Calculate the extended direct F-transform components (12) END WHILE (13) RETURN "ERROR: Dataset not sufficiently dense" (14) END Algorithm 1: Approximation of a set of data by using the extended inverse F-transform.using a trapezoidal FN as approximation function by, only a limited number of characteristics can be preserved since a trapezoidal FN depends only on four parameters, and the best approach to preserve multiple characteristics is to use sequences of FNs.In [14] a new method is proposed based on the inverse fuzzy transform (F-transform) [15] in order to construct sequence of FNs which converge uniformly to a FN, preserving properties as its support, core, ambiguity, quasiconcavity, and expected interval (Algorithm 1).The Ftransform method was already used in image analysis (see, e.g., [15][16][17][18]) and data analysis applications (see, e.g., [19,20]).In [21] the bidimensional F-transform is used to approximate type 2 FNs.In [13], the extended iF-transform method, proposed in [15], is applied to approximate FNs preserving the support and the quasiconcavity property.The main advantage of this method is to reach the desired approximation with a linear rate of uniform convergence.However, when the membership function is given in a discrete set of points, it is necessary to verify that this dataset is sufficiently dense with respect to the uniform fuzzy partition of the support of the FN.More specifically, the F-transform method divides the interval [a,b] in n subintervals of width h = (n-1)/(ba).The points x 1 = a, x 2 = a+h,. .., x i = a+(i-1)h,. .., x n = b are called nodes: a uniform fuzzy partition of [a,b] is created by assigning n fuzzy sets with continuous membership functions A

Acceptable
When the input data form a dataset of points in [a,b], it is necessary to control that this set is dense with respect to the uniform fuzzy partition; namely, we must verify that at least one data point with nonzero membership degree falls within a subinterval (x i-1 , x i+1 ) for i=1,. ..,n.In Figure 2 we show an example of dataset not sufficiently dense with respect to the fuzzy partition: no data is included in (x i-1 , x i+1 ).
The FNs are largely used in fuzzy reasoning systems, particularly in fuzzy rule-based inference systems in which fuzzy rules are applied in an inferential process.In a fuzzy rulebased inference system [22] the fuzzy rule set is composed of fuzzy rules, called "compositional rules of inference": each antecedent in a fuzzy rule is a fuzzy relation in which the min operator is applied for the conjunction and the max operator is applied for the disjunction of fuzzy sets.The max operator is applied for the aggregation of the rules as well.The discrete Center of Gravity (CoG) method is applied in the defuzzification process to obtain the final crisp value of the output variable.
We apply the iF-transform method for constructing the FN modeling the input variables in the antecedent and the output variables in the consequent of fuzzy rules in a Mamdani fuzzy inference system.
The paper is organized as follows: Section 2 contains the basic notions of fuzzy number and F-transform and in Section 3 we introduce the extended iF-transform method which in Section 4 is applied to a Fuzzy Rule-Based Systems (FRBS).In Section 5 we give the results of our tests, and final considerations are reported in Section 6. [17], the extended iFtransform method, proposed in [13], approximates a function  assigned on a discrete set of points by means of an iterative process.Strictly speaking, we set initially the dimension n of the fuzzy partition to a value n 0 ; afterwards it is necessary to verify at any step that the dataset is sufficiently dense with respect to the fuzzy partition and that the approximation error is less than or equal to a prefixed threshold: in this case the process stops and the direct F-transform components are stored; otherwise, n is set to n + 1 and the process is iterated by considering a finer fuzzy partition.Below, we schematize the pseudocode of this process.

Preliminaries. As already shown in
We propose a new Mamdani FRBS in which we use the extended iF-transform to approximate FNs and we apply the above process for constructing the input fuzzy sets in the antecedent and the output fuzzy sets.
The extended iF-transform method for approximation of the FNs is used to fuzzify the crisp input data.The min and max operators are applied as AND and OR connectives in the antecedent of the fuzzy rules to calculate the strength of any rule.The defuzzification process of the output fuzzy set is carried out via the discrete Center of Gravity (CoG) method.For example, we consider a system formed by two fuzzy rules in the following form: where A 1 and A 2 are two FNs for the linguistic input variable x, B 1 and B 2 are two FNs for the input linguistic variable y, and C 1 and C 2 are two FNs for the output variable z.Applying the extended iF-transforms to evaluate each fuzzy set, we suppose that  − 1 () = 0.4,  + 1 () = 0.7,  − 1 () = 0.7,  + 2 () = 0.3.With max (resp., min) operator as connective OR (resp., AND), we obtain the value of the two rules: r 1 = max(0.4,0.7) = 0.7 and r 2 = min(0.7,0,3) = 0.3.In the defuzzification process we reconstruct the output fuzzy set as where s 1 and s 2 are suitable thresholds prefixed a priori (Figure 3).The CoG method is useful for obtaining the final crisp value ẑ of the output variable as where Nc is the number of rules and z 1 < z 2 < ⋅ ⋅ ⋅ < z Nc are points of the support of C. In Figure 3 we give an example.

Fuzzy Numbers and F-Transforms
2.1.Fuzzy Numbers.Given a value  ∈[0, 1], we denote with A  , called -cut of a FN A, the crisp set containing the elements x∈R with a membership degree greater than or equal to .We also use the interval where ] is called the core of the FN and denoted by core(A).Note that for  = 0, The support of a fuzzy set is given by the closure of the crisp set Given two arbitrary FNs, A and B, two metrics are considered in [23,24]: the Chebyshev distance and the extension of the Euclidean metric given by Two properties of A are given in [25] called ambiguity and value, defined as and respectively, where r: [0, 1] → [0, 1] is a not decreasing function called reducing function with r(0) = 0 and r(1) = 1.Another important propriety is the expected interval of A, introduced in [3,24], defined as follows: We have EI(A) = [(a+c)/2, (d+b)/2] for a trapezoidal FN A.

Direct and Inverse F-Transforms.
Following the definitions and notations of [15], let n ≥ 2 and (1) A i (x i ) =1 for every i =1,2,. ..,n (2) A i (x) = 0 if x∉ (x i-1 ,x i+1 ) for i=2,. ..,n-1 (4) A i (x) strictly increases on [x i-1 , x i ] for i = 2, . .., n and strictly decreases on [x i ,x i+1 ] for i = 1,. .., n-1 Furthermore, we say that the fuzzy sets {A 1 ,. ..,A n } form an h-uniform fuzzy partition of [a,b] if (6) n ≥ 3 and x i = a + h⋅(i-1), where h = (b-a)/(n-1) and i = 1, 2, . .., n (that is, the nodes are equidistant) Let (x) be a continuous function on [a,b].The quantity for i = 1, . .., n, is the ith component of the direct F-transform {F 1 , F 2 , . .., F n } of f with respect to the family of basic functions If this fuzzy partition is h-uniform, the components are as follows [26]: The function where x∈[a,b], is defined as the iF-transform of f with respect to {A 1 , A 2 , . .., A n } and it approximates  in the sense of the following theorem [26].

eorem . Let f(x) be a continuous function on [a,b]. For every 𝜀 > 0, then there exist an integer n(𝜀) and a fuzzy partition {𝐴
with respect to the existing fuzzy partition.
In the discrete case we know that the function  assumes assigned values in the points p 1 ,. ..,p m of [a,b].If the set {p 1 ,. ..,p m } is sufficiently dense with respect to the fixed partition {A 1 , A 2 , . .., A n }, that is, for each i = 1,. ..,n, there exists an index j∈ {1,. ..,m} such that A i (p j ) > 0, we can define the n-tuple {F 1 , F 2 ,. .., F n } as the discrete direct F-transform of f with respect to {A 1 , A 2 , . .., A n }, where each F i is given by for i=1,. ..,n.Similarly we define the discrete iF-transform of f with respect to the {A 1 , A 2 , . .., A n } by setting for every j∈ {1,. ..,m}.We have the following theorem [15].remains true.

The Extended iF-Transform and Fuzzy Numbers
In [15] the extended iF-transform of a continuous function  is introduced in order to preserve the monotonicity as follows.For an h-uniform fuzzy partition {A 1 , A 2 , . .., A n }, the function  is extended to [a-h,b+h] as follows: Then the following basic functions are defined as Then the ith component   of the extended direct F-transform of  with respect to the family of basic functions {A 1 , A 2 , . .., A n } is given by Hence the extended iF-transform of  is given by By [13,Lemma 9], we obtain that where S i is the ith component of the direct F-transform of S (cfr., formulae (15)).Theorem 13 of [13] provides the approximation property of the extended iF-transform as follows.
eorem .Let S be a FN having a continuous membership function and supp() = [, ].Let a fuzzy partition { 1 , A 2 , . ..,   } of [, ] be h-uniform with n ≥ 3 and  , () be the extended iF-transform of S calculated by (23).Then the following inequality holds:  In order to apply the extended iF-transform to approximate a FN S with one-element core, in [13]

the concept of regular h-uniform partition of [a,b] is introduced as an huniform partition of [a,b] such that
then the extended iF-transform of  is defined for any x∈[a,b] as follows [13]: where  1 = (),   = (), and S i is the ith component of the direct F-transform of S in [a,b] for i=1,. ..,n.Similarly, it can be proved that all the above properties of the extended iF-transform of a FN with continuous membership function apply in the discrete case as well.

Extended iF-Transform and Fuzzy Rule-Based System
Let the expert knowledge be formed by a set of fuzzy rules in a linguistic fuzzy model: where x 1 , x 2 ,. .., x n are input variables, y is the output variable, X 1i , X 2i ,. .., X ni , Y i are fuzzy sets and the operator Δ i (i=1,. ..,n) is an AND or an OR operator.We construct a fuzzy rule set considering only AND connectives, splitting rules in which there are OR connectives in the antecedent.This fact can be also represented via a fuzzy relation equation.
We propose a FRBS in which the FNs of the fuzzy rule set are approximated by using extended iF-transforms.We suppose that the fuzzy sets in the antecedent and consequent of each rule are given by FNs whose membership functions

Crisp outputs
Extended Direct

F-transform components
Inference Engine

Fuzzy Inference System
Extended F-Transform approximation  [c,d] be the support of this FN.We approximate the membership function of it by the extended iF-transform calculated with (34).As already said above in Section 3, we find a fuzzy partition such that the set of points is sufficiently dense with respect to it and we apply the iterative process given in Section 1.1.For each FN in the antecedents and in the consequents of the fuzzy rules, we calculate the discrete extended direct F-transform storing them in the fuzzy rule set.The crisp input data are fuzzified via (34) by using the stored direct F-transform components of the FNs.The inference engine applies to the max-min Mamdani inference model to calculate the strength of each rule and to obtain the final fuzzy set aggregating the output fuzzy sets.The crisp output value is obtained by applying the CoG method.The FRBS is schematized in Figure 4.

Extended F-Transform Fuzzy Number Approximation
The extended iF-transform approximates each fuzzy number by considering the set of points in which its membership function is assigned.This function creates an h-uniform fuzzy partition of the support of the fuzzy set and verifies that the set of points is sufficiently dense with respect to the fuzzy partition.Initially n is set to a value n 0 (for example, n 0 = 3).If the set of points is not sufficiently dense with respect to the fuzzy partition, the F-transform approximation method cannot be applied; otherwise, the extended direct F-transform components and the approximation error are calculated.
If this error is less than a defined threshold, the process stops and the extended direct F-transform components are stored; otherwise, n is increased by 1 and the process is iterated.
If the set of points is not sufficiently dense with respect to the fuzzy partition, the process stops with an error and the previous extended direct F-transform components are stored.
In this last case, the best possible approximation of the FN is obtained, even if the approximation error is higher than the threshold.In order to create an h-uniform fuzzy partition of [a,b], the following basic functions are used: The approximation error is given by the Root Mean Square Error (RMSE) defined as Description: Approximate a fuzzy number with an extended iFtransform Input: Initial fuzzy partition size n 0 Threshold parameter A set of m points and their membership function value ( 1 , ( 1 )), . . ., (  , (  )) Output: RMSE error Extended Direct F-transform components (1) nfl n 0 (2) Read the dataset of points (3) Create a h-uniform fuzzy partition by using the basic functions (36) (4) Calculate the extended direct F-transform components (5) WHILE the dataset is sufficiently dense with respect to the fuzzy partition (6) Calculate the RMSE approximation error (37) (7) IF (RMSE approximation error ≤ threshold) THEN (8) Store the extended direct F-transform components and the RSME error (9) RETURN "Success" (10) END IF (11) nfln+1 (12) Create a h-uniform fuzzy partition by using the basic functions (36) (13) Calculate the extended direct F-transform components (14) END WHILE (15) Store the extended direct previous F-transform components (n = n-1) and the RMSE error (16) RETURN "ERROR: Dataset non sufficiently dense" (17) END Algorithm 2: Extended F-transform approximation.
The threshold for the RMSE is set as a positive value much smaller than 1.The extended iF-transform method is schematized in Algorithm 2.
The fuzzification reads the input data and calculates the membership degree of each fuzzy set related to the input variable using (34).The strength of each rule is obtained via the min connective.If    ℎ (  ) is the approximated membership degree of the input variable x k , the strength of the kth rule is as follows: The output fuzzy set is constructed as follows: where    () is the approximated membership function of the output variable to the fuzzy set in the consequent of the kth rule.The defuzzification function implements the CoG algorithm for converting the fuzzy output in a crisp number.We partition the support of the output fuzzy set in N B intervals with equal width.Let y i be the value of the midpoint of the ith interval.The output crisp value ŷ is as follows: We test our FRBS to a spatial decision problem in Section 5.

Experimental Results: The Livability in Residential Housings
We apply the extended F-transform in a FRBS based on a set of census data of the 92 municipalities of the district of Naples (Italy), related to the residential housing.Our aim is to evaluate their livability whose crisp output variable is evaluated in percentage on the basis of a set of fuzzy rules extracted by experts in which the following six linguistic input variables are considered: x 1 = average surface of the housings in m 2 , x 2 = percentage of housings with six or more rooms, x 3 = percentage of residential buildings built since 2000, x 4 = percentage of housings with centralized or autonomous heating system, x 5 = percentage of housings with two or more showers or bathtubs, and x 6 = percentage of housings with two or more restrooms.The crisp input data are extracted from the ISTAT dataset.The crisp value of the variable x 1 is given by the total surface of the housings in the municipality dividing by the number of housings.The crisp values of the variables x 2 , . .., x 6 are obtained dividing the corresponding absolute value recorded in the dataset by the total number of housings in the municipality.The domain of any variable is partitioned in 5 fuzzy sets labeled as "Low", "Mean Low", "Mean", "Mean High", and "High".The fuzzy rule set contains the 62 fuzzy rules in Table 1 constructed by a set of twenty experts.
In the preprocessing phase we apply the extended Ftransform based algorithm to approximate the five FNs associated with each variable.Each FN is obtained as average   of the membership values assigned by the experts in 200 points.
In Figure 5 we show some FNs and their approximations obtained by applying the extended F-transform.We set the threshold to 0.01, so having a RMSE less than 0.01 for every FN.
In Table 3 we show the parameters a, c, d, b of the FNs used for the output variable y and the RMSE obtained applying the extended F-transform.
At the end of the preprocessing phase, the fuzzification of the input data is performed as well.In Figures 6(a)-6(f) we show the thematic maps (in a Geographic Information System environment) of the six input variables x i (i = 1,2, 3, 4, 5, 6), respectively, in the municipalities of the district of Naples.In each map the municipality is classified with the

Conclusions
We present a new method based on the extended F-transform to approximate FNs.We apply this method in a fuzzy rulebased system of Mamdani type related to a spatial analysis problem consisting in the evaluation of the livability of residential housings in the municipality of the district of Naples.In many spatial analysis problems, decision-making systems based on expert rules are used in order to extract thematic maps of a final index.A finer approximation of the membership functions of the fuzzy sets in the antecedents and in the consequence of the fuzzy rules is necessary to guarantee a good reliability of the final thematic maps.In many cases, for example, in participatory contexts in which knowledge is provided by different experts, these FNs are assigned on a discrete set of points.In future we propose to apply the extended F-transform method to the approximation of FNs in multicriteria fuzzy decision-making problems.Data analysis shall be another field of investigation, mainly for establishing linear dependency of attributes from other attributes in large datasets via a fuzzy number: this is useful for the reduction of the size of these datasets.

Figure 1 :
Figure 1: Example of FN constructed for a discrete set of points and approximated with a trapezoidal membership function.
sufficiently dense with respect to the fuzzy partition h = (b-a)/(n-1)

Figure 2 :
Figure 2: Example of input dataset nonsufficiently dense with respect to the fuzzy partition.

Figure 5 :
Figure 5: Fuzzy numbers x 1 = Low, x 2 = Mean, x 3 = Mean High, and x 4 = High (in blue) and their extended iF-transform approximations (in red).
(c) Parameters and RMSE of the approximation for fuzzy sets of x 3 Parameters and RMSE of the approximation for fuzzy sets of x 4 Parameters and RMSE of the approximation for fuzzy sets of x 5 Parameters and RMSE of the approximation for fuzzy sets of x 6

Table 2 (
a) Parameters and RMSE of the approximation for fuzzy sets of x 1

Table 6 :
Municipalities with different livability class.