# Extended Fuzzy-Based Models of Production Data Analysis within AI-Based Industry 4.0 Paradigm
## 2 Materials and Methods
### Methods  
Fuzzy logic reduces the ambiguity of making decisions regarding the selection of a tool for machining [38; 39; 40; 41]. It is realized by transforming descriptive imprecise information expressed by the technologist/operator of the device into numerical data in the Mamdani-type fuzzy model. After such a process, the linguistic data can be processed by computing systems, which improves the exchange of information between humans and the computing system. This is progress towards the development of computational models of devices, processes, and products (digital twins) that improve the prediction of errors, failures, and downtime while also improving accuracy, efficiency, and safety [42; 43]. Identification of the Fuzzy Sets for the Inputs  
The identification of the input variables is based on the clustering of the reference dataset. We use eight parameters to describe the machining conditions (see the description column in Table 1). Thus, a single reference data (a data row) is a set of eight numerical input parameters that are specific to a particular machining tool. Overall, we use data rows for 17 different tools that cover most of the machining operating conditions. It is worth noting that some tools are described by one row of data, others by two or four. In summary, we have 47 rows of data that indicate 17 different tools for machining. As can be seen from the above, we have 47 benchmark values for each input parameter. However, although we have many values, they are often repeated for different tools. A cluster is the number of occurrences of a given value (or range) in the reference data. The values and their occurrences shown in Table 1 are the basic clusters for further clustering to define fuzzy sets. The identification of fuzzy sets for input variables is done by some steps of collecting neighboring initial clusters into extended clusters, which we can call granules. Such granules can be represented by intervals of values of a given input space. These intervals are represented as trapezoidal fuzzy sets. Generally, we take into consideration two coefficients/characteristics of the available reference data:  
* The relative increase in the values of a given linguistic variable. * The total number of occurrences of data representing a given interval of values of that variable. To summarize, the general process of defining fuzzy sets groups clusters of data and transforms their range into a fuzzy interval that is representative of a given input variable. Version 1 and Version 2 differ in the assignment of clusters from the reference data. In Variant 1, the assumptions were intuitive. The grouping of clusters into granules, represented by fuzzy sets (starting from lower values), proceeds as follows:  
* If the total number of occurrences in the clusters is less than 25%, and the interval of values of a given space is greater than 50% (of the entire range of this variable), we indicate the entire group as a new fuzzy set (new quality). * If the number of occurrences is between 25 and 50%, and the value interval is greater than 25% of the entire range of this variable, we transform the clustered data into a fuzzy set. * If the number of occurrences is above 50% and the value increment in the reference data is 10%, we indicate a new fuzzy set. It is worth noting that after defining a new fuzzy granule/set, if there are clusters that are not clustered, we start clustering them for the next fuzzy set. All of the above steps represent intuitive mechanisms for clustering data, which we can present as follows:  
* We group the data into larger clusters if the set of basic clusters is small but represents a wide range of values. * We group the data if the set of basic clusters is medium, and they represent a medium range of values. * We group the data if the set of basic clusters is large, even if the data they represent has a small range of values.