# Integration of the Wang & Mendel Algorithm into the Application of Fuzzy Expert Systems to Intelligent Clinical Decision Support Systems

^{1}

^{2}

^{*}

## Abstract

**:**

## 1. Introduction

- For the processing of the data related to the patient’s health profile, that is, for the objective data, different machine learning classification algorithms are considered, working concurrently [1,2,4,5,8,10,11,12], each of which is associated with different AHI threshold levels as in the approach in the first work, and through which it is possible to obtain a set of risk indicators, called Statistical Risks.
- The data relating to the patient’s symptoms, that is, those of a subjective nature, are processed in a similar way to the approach in the second work, using a series of expert systems arranged in a cascade, the output of which determines an indicator, the Symbolic Risk, a common value for the patient, applicable to all AHI levels.

- Motivation and Conceptual Approach

#### 1.1. Wang and Mendel’s Method

_{1},t

_{2}; w)), and from potential fuzzy rules proposed by experts. Both rules will be combined into a knowledge base from which inferences can be performed—as in the example before: f(t

_{1},t

_{2}) → w.

- Stage prior to the application of the method: before applying the Wang–Mendel algorithm, the dataset to be used is prepared by identifying the input and output variables. The range of each variable, that is, their maximum and minimum values, is also determined. The user must also select the type of membership function to use. The original proposal by Wang and Mendel envisaged the use of triangular membership functions. It is also necessary to define the value of N for each variable, which must be an integer greater than or equal to one. This value is used to determine the number of sections for each of the associated membership functions.
- Stage 1—Division of the input and output spaces into fuzzy regions: in this stage, for each of the input and output variables considered, the problem domain is divided into 2N + 1 sections, in this case using triangular functions, as originally proposed in the paper of Wang and Mendel [40]. 2N + 1 sections are added, since the goal is to perform a division of the domain of each of the variables in such a way that there is a central or intermediate section. Figure 2 shows an example for N = 1, with three segments of the membership function (L, M, and H) for the two input variables (t
_{1},t_{2}) and the output variable (w) of the previous example. As can be seen, and in line with the proposal of the original paper, there is an overlap of the triangles, so that if the top vertex of the central triangle has a maximum degree of membership, at the same point the vertices of the neighboring triangles have minimum degrees of membership. - Stage 2—Generation of fuzzy rules from the input-output data pairs: once the sections of the membership function associated with each variable have been determined, the rules are to be generated. This is done by first determining the degrees of membership associated with each of the sections of the different functions for each of the different lines of the initial dataset. For this purpose, the variables are fuzzified through their respective membership functions on the basis of the data available in the dataset. For example, in Figure 3, it can be seen that for a given observation of the variable t
_{1}, it has a degree of membership of 0.3 to Lt_{1}and a degree of membership of 0.7 to Mt_{1}. For variable t_{2}, it is observed that it has a degree of membership of 0.45 to Mt_{2}and a degree of membership of 0.55 to Ht_{2}. In the case of w, it is observed that it has degrees of membership from 1 to Mw. After that, in each of the rows of the dataset, each variable is assigned to the section with the maximum degree of membership, determining a rule for each row. For the case in Figure 3, taking the maximum degrees of membership, the following would be obtained: (t_{1}^{(1)}, t_{2}^{(1)}; w^{(1)}) → IF t_{1}is Mt_{1}and t_{2}is Ht_{2}, THEN w is Mw. As mentioned above, this process is carried out for each of the different rows of the dataset, with a rule being determined for each of these rows. - Stage 3—Assignation of a degree to each of the rules to solve potential conflicts among the generated rules: the initial numerical set may include observations that, after applying Stage 2, generate rules that could be in conflict, that is, their antecedent part is the same while the consequent part is different. To deal with this problem, Wang and Mendel propose to associate each rule with a degree in order to select only those rules that have a maximum degree, thus dispensing with a large part of the rules generated in the previous stage. The degree value associated with each rule would be determined as the product of the degrees of membership of the observation that gave rise to the rule, as can be seen in Equation (1), which is particularized in Equation (2) for the case shown in Figure 3. In this case, after carrying out this process for all the rules and selecting those that maximize the coefficient value obtained, the resulting rule base would have the structure shown in Figure 4, with each of the boxes containing a section of the membership function of the consequent, if this combination were possible and present in the initial dataset.$${D}_{rulei}={\mu \left({x}_{1}\right)}_{i}\xb7{\mu \left({x}_{2}\right)}_{i}\xb7{\mu \left(y\right)}_{i}$$$${D}_{rule1}={\mu \left({t}_{1}\right)}_{1}\xb7{\mu \left({t}_{2}\right)}_{1}\xb7{\mu \left(w\right)}_{1}=0.70\xb70.55\xb71=0.39$$
- Stage 4—Building of the combined fuzzy knowledge base: once the knowledge base has been determined by the Wang–Mendel algorithm, whose structure is shown in Figure 4, it could be enriched by a set of fuzzy rules expressed by the expert team. These rules, which in Wang-Mendel’s definition are called linguistic rules or expert rules, would be incorporated into the knowledge base after being assigned a certain degree of importance by the expert team. In the case of conflict between the rule proposed by the expert and the rule generated by the algorithm in any of the boxes, Wang and Mendel advocate using the one with the maximum degree.

## 2. Materials and Methods

#### 2.1. Definition of the System

#### 2.1.1. Database Usage

#### 2.1.2. Conceptual Design and Description of the System

#### Stage 1: Collection of Patient Information

#### Stage 2: Determination of the Values of Statistical Risk and Symbolic Risk Values

#### Stage 3: Determination of the Apnea Risk Level for Each AHI Threshold Level

#### Stage 4: Generation of Alerts and Decision-Making

#### 2.2. Implementation of the System

#### 2.2.1. Data Collection

#### 2.2.2. Data Processing

#### Machine Learning Algorithms

#### Cascaded Expert Systems

#### Risk Aggregation by Means of Fuzzy Expert Systems with an Automatically Generated Knowledge Base

- Determination of Knowledge Bases Using Wang and Mendel Algorithm

- Proof Test Results

- Determination of a Threshold Level for Each AHI Level

#### 2.2.3. Generation of Alerts and Decision-Making

## 3. Case Study

#### 3.1. Collection of the Patient’s Information

#### 3.2. Data Processing

#### Risk Aggregation

#### 3.3. Generation of Alerts and Decision-Making

## 4. Discussion

#### 4.1. Advantages and Disadvantages of the Aggregation Process

- By dealing with the risk values, the algorithm acts indirectly by reducing the enormous dimensionality of the problem by reducing and synthesizing the relationships between the initial variables through their representation and influence on the Statistical and Symbolic Risks.
- There is no need to define and find explicit knowledge for risk aggregation. The numerical data representing them, the risks, as well as the labels that complete each line of data can be interpreted as a non-formal pseudo-logical statement that serves as a basis for establishing a fuzzy rule.
- It is possible to combine the automatically generated rules with others generated by experts, thus completing a knowledge base with a more general scope and wider applicability.
- It allows a circumstantial logical formalization of the knowledge derived from the direct interpretation of numerical data, which is a differential milestone. This incorporates explanatory capabilities into the aggregation model and allows its validation by logical procedures.
- It allows the diversification of the risk aggregation knowledge base in its most basic form. This means that it is possible to understand that the rules form a knowledge base that can be exported to other examples once they have been created and defined.
- It reduces uncertainty in all its variants and interpretations, not only by incorporating fuzzy systems but also by not introducing aggregation models with optional or optimizable parameters.
- From the different proofs of concept elaborated, of which the case study is an example, it is possible to observe a trend towards finding accurate classifiers for each of the AHI thresholds identified. The AUCs of the ROC curves for each of them extend their area above 0.74 (1 would be a perfect classifier), which in itself would not represent a notable difference with those obtained by other simple or combined machine and deep learning algorithms if one did not take into account a differentiating factor: explainability.
- Explainability is a fair measure of the differential value of automated fuzzy rule generation from numerical data sets. Although this model, unlike traditional knowledge acquisition models, allows the aggregation of parameters with symbolic inference without the obligation of creating logical knowledge bases, it shares with them the ability to explain—that is, to understand, comprehend, and reason—the inference process. However, in order for these new bases to have a permanent, not to say ontological, character, they must be verified by the team of expert pulmonologists.

- The first origin of the rules is the set of objective and subjective, numeric and categorical data from which the initial set of objective and subjective data, represented by its risk measures and class labels, was derived. These data are, by definition, ephemeral and mutable, so the rules derived from them will inherit these characteristics. Therefore, although the result of the application of the algorithm is a set of fuzzy rules, they will necessarily need to be interpreted by the expert team in order to consolidate them into a permanent knowledge base.
- Although the application of the algorithm results in a set of fuzzy rules, it is essential that they be interpreted by a team of experts in order to consolidate them into a permanent knowledge base.
- The logical operators that relate the antecedents must be defined in advance, which implies a prior assumption that may not be true.
- The algorithm classifies and ranks the rules according to a degree value, calculated as the product of the membership values of the set of antecedents and consequents of each rule. In the case of rules having similar antecedents, those with a higher degree are given priority, and the others are eliminated. This, in fact, implies a loss of knowledge due to the operation of the algorithm itself, which will have to be taken into account in due course. In more or less well-known applications where prior knowledge exists, this is not a very significant loss. However, in medical diagnosis it may lead to non-negligible error rates, and therefore, in the future, it will be necessary to study mechanisms to reduce the loss of knowledge generated by the approach of generating deductive rules on fuzzy sets proposed by Wang and Mendel [40].

#### 4.2. Comparison of Systems

## 5. Conclusions

## Author Contributions

## Funding

## Institutional Review Board Statement

## Data Availability Statement

## Acknowledgments

## Conflicts of Interest

## References

- Casal-Guisande, M.; Torres-Durán, M.; Mosteiro-Añón, M.; Cerqueiro-Pequeño, J.; Bouza-Rodríguez, J.-B.; Fernández-Villar, A.; Comesaña-Campos, A. Design and Conceptual Proposal of an Intelligent Clinical Decision Support System for the Diagnosis of Suspicious Obstructive Sleep Apnea Patients from Health Profile. Int. J. Environ. Res. Public Health
**2023**, 20, 3627. [Google Scholar] [CrossRef] [PubMed] - Casal-Guisande, M.; Ceide-Sandoval, L.; Mosteiro-Añón, M.; Torres-Durán, M.; Cerqueiro-Pequeño, J.; Bouza-Rodríguez, J.-B.; Fernández-Villar, A.; Comesaña-Campos, A. Design of an Intelligent Decision Support System Applied to the Diagnosis of Obstructive Sleep Apnea. Diagnostics
**2023**, 13, 1854. [Google Scholar] [CrossRef] - Casal-Guisande, M.; Bouza-Rodríguez, J.B.; Comesaña-Campos, A.; Cerqueiro-Pequeño, J. Proposal and Definition of a Methodology for Remote Detection and Prevention of Hypoxemic Clinical Cases in Patients Susceptible to Respiratory Diseases. In Proceedings of the Seventh International Conference on Technological Ecosystems for Enhancing Multiculturality, León, Spain, 16–18 October 2019; pp. 331–338. [Google Scholar] [CrossRef]
- Casal-Guisande, M.; Comesaña-Campos, A.; Cerqueiro-Pequeño, J.; Bouza-Rodríguez, J.-B. Design and Development of a Methodology Based on Expert Systems, Applied to the Treatment of Pressure Ulcers. Diagnostics
**2020**, 10, 614. [Google Scholar] [CrossRef] [PubMed] - Casal-Guisande, M.; Comesaña-Campos, A.; Dutra, I.; Cerqueiro-Pequeño, J.; Bouza-Rodríguez, J.-B. Design and Development of an Intelligent Clinical Decision Support System Applied to the Evaluation of Breast Cancer Risk. J. Pers. Med.
**2022**, 12, 169. [Google Scholar] [CrossRef] [PubMed] - Casal-Guisande, M.; Cerqueiro-Pequeño, J.; Comesaña-Campos, A.; Bouza-Rodríguez, J.B. Proposal of a Methodology Based on Expert Systems for the Treatment of Diabetic Foot Condition. In Proceedings of the Eighth International Conference on Technological Ecosystems for Enhancing Multiculturality, Salamanca, Spain, 21–23 October 2020; ACM: New York, NY, USA; pp. 491–495. [Google Scholar]
- Casal-Guisande, M.; Comesaña-Campos, A.; Pereira, A.; Bouza-Rodríguez, J.-B.; Cerqueiro-Pequeño, J. A Decision-Making Methodology Based on Expert Systems Applied to Machining Tools Condition Monitoring. Mathematics
**2022**, 10, 520. [Google Scholar] [CrossRef] - Cerqueiro-Pequeño, J.; Comesaña-Campos, A.; Casal-Guisande, M.; Bouza-Rodríguez, J.-B. Design and Development of a New Methodology Based on Expert Systems Applied to the Prevention of Indoor Radon Gas Exposition Risks. Int. J. Environ. Res. Public Health
**2020**, 18, 269. [Google Scholar] [CrossRef] - Cerqueiro-Pequeño, J.; Casal-Guisande, M.; Comesaña-Campos, A.; Bouza-Rodríguez, J.-B. Conceptual Design of a New Methodology Based on Intelligent Systems Applied to the Determination of the User Experience in Ambulances. In Proceedings of the Ninth International Conference on Technological Ecosystems for Enhancing Multiculturality (TEEM’21), Barcelona, Spain, 26–29 October 2021; pp. 290–296. [Google Scholar] [CrossRef]
- Casal-Guisande, M.; Álvarez-Pazó, A.; Cerqueiro-Pequeño, J.; Bouza-Rodríguez, J.-B.; Peláez-Lourido, G.; Comesaña-Campos, A. Proposal and Definition of an Intelligent Clinical Decision Support System Applied to the Screening and Early Diagnosis of Breast Cancer. Cancers
**2023**, 15, 1711. [Google Scholar] [CrossRef] - Casal-Guisande, M.; Bouza-Rodríguez, J.-B.; Cerqueiro-Pequeño, J.; Comesaña-Campos, A. Design and Conceptual Development of a Novel Hybrid Intelligent Decision Support System Applied towards the Prevention and Early Detection of Forest Fires. Forests
**2023**, 14, 172. [Google Scholar] [CrossRef] - Comesaña-Campos, A.; Casal-Guisande, M.; Cerqueiro-Pequeño, J.; Bouza-Rodríguez, J.B. A Methodology Based on Expert Systems for the Early Detection and Prevention of Hypoxemic Clinical Cases. Int. J. Environ. Res. Public Health
**2020**, 17, 8644. [Google Scholar] [CrossRef] - Suthaharan, S. Machine Learning Models and Algorithms for Big Data Classification; Springer: Boston, MA, USA, 2016; Volume 36, ISBN 978-1-4899-7640-6. [Google Scholar]
- Zhou, Z.-H. Machine Learning; Springer: Singapore, 2021; ISBN 978-981-15-1966-6. [Google Scholar]
- Deo, R.C. Machine Learning in Medicine. Circulation
**2015**, 132, 1920–1930. [Google Scholar] [CrossRef] - Tang, Y.; Huang, J.; Pedrycz, W.; Li, B.; Ren, F. A Fuzzy Clustering Validity Index Induced by Triple Center Relation. IEEE Trans. Cybern.
**2023**, 1–13. [Google Scholar] [CrossRef] [PubMed] - Celebi, M.E.; Aydin, K. Unsupervised Learning Algorithms; Springer International Publishing: Cham, Switzerland, 2016; ISBN 978-3-319-24209-5. [Google Scholar]
- Raza, K.; Singh, N.K. A Tour of Unsupervised Deep Learning for Medical Image Analysis. Curr. Med. Imaging
**2021**, 17, 1059–1077. [Google Scholar] [CrossRef] - Jabbar, H.K.; Zaman Khan, R. Survey on Development of Expert System from 2010 to 2015. In Proceedings of the Second International Conference on Information and Communication Technology for Competitive Strategies, Udaipur, India, 4–5 March 2016. [Google Scholar] [CrossRef]
- Sheikhtaheri, A.; Sadoughi, F.; Hashemi Dehaghi, Z. Developing and Using Expert Systems and Neural Networks in Medicine: A Review on Benefits and Challenges. J. Med. Syst.
**2014**, 38, 1–6. [Google Scholar] [CrossRef] [PubMed] - Arsene, O.; Dumitrache, I.; Mihu, I. Expert System for Medicine Diagnosis Using Software Agents. Expert Syst. Appl.
**2015**, 42, 1825–1834. [Google Scholar] [CrossRef] - Masri, R.Y.; Mat Jani, H. Employing Artificial Intelligence Techniques in Mental Health Diagnostic Expert System. In Proceedings of the 2012 International Conference on Computer & Information Science (ICCIS), Kuala Lumpur, Malaysia, 12–14 June 2012; Volume 1, pp. 495–499. [Google Scholar] [CrossRef]
- Djam, X.Y.; Wajiga, G.M.; Kimbi, Y.H.; Blamah, N.V. A Fuzzy Expert System for the Management of Malaria. Int. J. Pure Appl. Sci. Technol.
**2011**, 5, 84–108. [Google Scholar] - Yasnoff, W.A.; Miller, P.L. Decision Support and Expert Systems in Public Health; Springer: London, UK, 2014; pp. 449–467. [Google Scholar]
- Torshizi, A.D.; Zarandi, M.H.F.; Torshizi, G.D.; Eghbali, K. A Hybrid Fuzzy-Ontology Based Intelligent System to Determine Level of Severity and Treatment Recommendation for Benign Prostatic Hyperplasia. Comput. Methods Programs Biomed.
**2014**, 113, 301–313. [Google Scholar] [CrossRef] - Benjafield, A.V.; Ayas, N.T.; Eastwood, P.R.; Heinzer, R.; Ip, M.S.M.; Morrell, M.J.; Nunez, C.M.; Patel, S.R.; Penzel, T.; Pépin, J.L.D.; et al. Estimation of the Global Prevalence and Burden of Obstructive Sleep Apnoea: A Literature-Based Analysis. Lancet Respir. Med.
**2019**, 7, 687–698. [Google Scholar] [CrossRef] - Thurnheer, R.; Bloch, K.E.; Laube, I.; Gugger, M.; Heitz, M. Respiratory Polygraphy in Sleep Apnoea Diagnosis. Swiss Med. Wkly.
**2007**, 137, 97–102. [Google Scholar] - Alonso Álvarez, M.d.l.L.; Terán Santos, J.; Cordero Guevara, J.; Martínez, M.G.; Rodríguez Pascual, L.; Viejo Bañuelos, J.L.; Marañón Cabello, A. Fiabilidad de La Poligrafía Respiratoria Domiciliaria Para El Diagnóstico Del Síndrome de Apneas-Hipopneas Durante El Sueño. Análisis de Costes. Arch. Bronconeumol.
**2008**, 44, 22–28. [Google Scholar] [CrossRef] [PubMed] - Calleja, J.M.; Esnaola, S.; Rubio, R.; Durán, J. Comparison of a Cardiorespiratory Device versus Polysomnography for Diagnosis of Sleep Apnoea. Eur. Respir. J.
**2002**, 20, 1505–1510. [Google Scholar] [CrossRef] - Douglas, N.J.; Thomas, S.; Jan, M.A. Clinical Value of Polysomnography. Lancet
**1992**, 339, 347–350. [Google Scholar] [CrossRef] [PubMed] - Rundo, J.V.; Downey, R. Polysomnography. In Handbook of Clinical Neurology; Elsevier: Amsterdam, The Netherlands, 2019; Volume 160, pp. 381–392. [Google Scholar]
- Kapur, V.K.; Auckley, D.H.; Chowdhuri, S.; Kuhlmann, D.C.; Mehra, R.; Ramar, K.; Harrod, C.G. Clinical Practice Guideline for Diagnostic Testing for Adult Obstructive Sleep Apnea: An American Academy of Sleep Medicine Clinical Practice Guideline. J. Clin. Sleep Med.
**2017**, 13, 479–504. [Google Scholar] [CrossRef] [PubMed] - Punjabi, N.M. The Epidemiology of Adult Obstructive Sleep Apnea. Proc. Am. Thorac. Soc.
**2008**, 5, 136–143. [Google Scholar] [CrossRef] [PubMed] - Ramachandran, A.; Karuppiah, A. A Survey on Recent Advances in Machine Learning Based Sleep Apnea Detection Systems. Healthcare
**2021**, 9, 914. [Google Scholar] [CrossRef] [PubMed] - Mostafa, S.S.; Mendonça, F.; Ravelo-García, A.G.; Morgado-Dias, F. A Systematic Review of Detecting Sleep Apnea Using Deep Learning. Sensors
**2019**, 19, 4934. [Google Scholar] [CrossRef] - Denis Bouyssou, T.; Marchant, M.P.; Tsoukiàs, P.V. Evaluation and Decision Models with Multiple Criteria: Stepping Stones for the Analyst; Springer: New York, NY, USA, 2006; ISBN 978-1-4419-4053-7. [Google Scholar]
- Theil, H. Alternative Approaches to the Aggregation Problem. Stud. Log. Found. Math.
**1966**, 44, 507–527. [Google Scholar] [CrossRef] - Pomerol, J.-C.; Barba-Romero, S. Multicriterion Decision in Management. Principles and Practice; Springer Science & Business: New York, NY, USA, 2000. [Google Scholar]
- Allen, B. On the Aggregation of Preferences in Engineering Design. In Proceedings of the International Design Engineering Technical Conferences and Computers and Information in Engineering Conference, Pittsburgh, PA, USA, 9–12 September 2001; Volume 2, pp. 57–67. [Google Scholar] [CrossRef]
- Wang, L.X.; Mendel, J.M. Generating Fuzzy Rules by Learning from Examples. IEEE Trans. Syst. Man Cybern.
**1992**, 22, 1414–1427. [Google Scholar] [CrossRef] - Mitchell, T.M. Machine Learning; McGraw-Hill Education: Maidenhead, UK, 1997. [Google Scholar]
- Neale, I.M. First Generation Expert Systems: A Review of Knowledge Acquisition Methodologies. Knowl. Eng. Rev.
**1988**, 3, 105–145. [Google Scholar] [CrossRef] - Steels, L. Second Generation Expert Systems. Future Gener. Comput. Syst.
**1985**, 1, 213–221. [Google Scholar] [CrossRef] - Rubin, S.H.; Murthy, J.; Ceruti, M.G.; Milanova, M.; Ziegler, Z.C.; Rush, R.J., Jr. Third-Generation Expert Systems. In Proceedings of the 2nd International ISCA Conference on Information Reuse and Integration (IRI-2000), Honolulu, HI, USA, 1–3 November 2000; pp. 27–34. [Google Scholar]
- Mamdani, E.H. Advances in the Linguistic Synthesis of Fuzzy Controllers. Int. J. Man-Mach. Stud.
**1976**, 8, 669–678. [Google Scholar] [CrossRef] - Mamdani, E.H. Application of Fuzzy Logic to Approximate Reasoning Using Linguistic Synthesis. IEEE Trans. Comput.
**1977**, C-26, 1182–1191. [Google Scholar] [CrossRef] - Mamdani, E.H.; Assilian, S. An Experiment in Linguistic Synthesis with a Fuzzy Logic Controller. Int. J. Man-Mach. Stud.
**1975**, 7, 1–13. [Google Scholar] [CrossRef] - Ross, T.J. Fuzzy Logic with Engineering Applications, 3rd ed.; John Wiley & Sons, Ltd.: Chichester, UK, 2010; ISBN 9781119994374. [Google Scholar]
- Boughorbel, S.; Jarray, F.; El-Anbari, M. Optimal Classifier for Imbalanced Data Using Matthews Correlation Coefficient Metric. PLoS ONE
**2017**, 12, e0177678. [Google Scholar] [CrossRef] [PubMed] - Chicco, D.; Jurman, G. The Advantages of the Matthews Correlation Coefficient (MCC) over F1 Score and Accuracy in Binary Classification Evaluation. BMC Genom.
**2020**, 21, 1–13. [Google Scholar] [CrossRef] [PubMed] - Guilford, J.P. Psychometric Methods; McGraw-Hill: New York, NY, USA, 1954. [Google Scholar]
- Hevner, A.R.; Chatterjee, S. Design Research in Information Systems: Theory and Practice; Springer: New York, NY, USA, 2010; ISBN 978-1-4419-6107-5. [Google Scholar]
- Hevner, A.R.; March, S.T.; Park, J.; Ram, S. Design Science in Information Systems Research. MISQ
**2004**, 28, 75–105. [Google Scholar] [CrossRef] - MATLAB App Designer—MATLAB & Simulink. Available online: https://es.mathworks.com/products/matlab/app-designer.html (accessed on 10 August 2022).
- Classification Learner. Available online: https://www.mathworks.com/help/stats/classificationlearner-app.html (accessed on 18 October 2022).
- Fuzzy Logic Toolbox—MATLAB. Available online: https://www.mathworks.com/products/fuzzy-logic.html (accessed on 1 November 2022).
- Imbalanced-Learn. Available online: https://imbalanced-learn.org/dev/index.html (accessed on 18 October 2022).
- Agresti, A. Categorical Data Analysis; John Wiley & Sons, Inc.: Hoboken, NJ, USA, 2002; ISBN 0471360937. [Google Scholar]
- Powers, D.; Xie, Y. Statistical Methods for Categorical Data Analysis; Emerald Group Publishing: Bingley, UK, 2008. [Google Scholar]
- Mohammed, A.J.; Hassan, M.M.; Kadir, D.H. Improving Classification Performance for a Novel Imbalanced Medical Dataset Using Smote Method. Int. J. Adv. Trends Comput. Sci. Eng.
**2020**, 9, 3161–3172. [Google Scholar] [CrossRef] - Chawla, N.V.; Bowyer, K.W.; Hall, L.O.; Kegelmeyer, W.P. SMOTE: Synthetic Minority Over-Sampling Technique. J. Artif. Intell. Res.
**2002**, 16, 321–357. [Google Scholar] [CrossRef] - Miller, G.A. The Magical Number Seven, plus or Minus Two: Some Limits on Our Capacity for Processing Information. Psychol. Rev.
**1956**, 63, 81–97. [Google Scholar] [CrossRef] - Kumari, R.; Srivastava, S. Machine Learning: A Review on Binary Classification. Int. J. Comput. Appl.
**2017**, 160, 11–15. [Google Scholar] [CrossRef] - Duda, R.O.; Hart, P.E.; Stork, D.G. Pattern Classification; Wiley: Hoboken, NJ, USA, 2000. [Google Scholar]
- Atacak, I. An Ensemble Approach Based on Fuzzy Logic Using Machine Learning Classifiers for Android Malware Detection. Appl. Sci.
**2023**, 13, 1484. [Google Scholar] [CrossRef] - Melin, P.; Monica, J.C.; Sanchez, D.; Castillo, O. Multiple Ensemble Neural Network Models with Fuzzy Response Aggregation for Predicting COVID-19 Time Series: The Case of Mexico. Healthcare
**2020**, 8, 181. [Google Scholar] [CrossRef] [PubMed] - Ahmed, U.; Issa, G.F.; Khan, M.A.; Aftab, S.; Khan, M.F.; Said, R.A.T.; Ghazal, T.M.; Ahmad, M. Prediction of Diabetes Empowered With Fused Machine Learning. IEEE Access
**2022**, 10, 8529–8538. [Google Scholar] [CrossRef] - Rahman, A.U.; Abbas, S.; Gollapalli, M.; Ahmed, R.; Aftab, S.; Ahmad, M.; Khan, M.A.; Mosavi, A. Rainfall Prediction System Using Machine Learning Fusion for Smart Cities. Sensors
**2022**, 22, 3504. [Google Scholar] [CrossRef] [PubMed]

**Figure 1.**Diagram of the method for generating declarative rules on fuzzy sets as proposed by Wang and Mendel, showing each of the five stages over which the algorithm is deployed [40].

**Figure 3.**Example of the determination of degrees of membership based on the value obtained for the variables t

_{1}, t

_{2}and w in the initial dataset.

**Figure 4.**Distribution of the knowledge base generated by the Wang Mendel algorithm where the fuzzy rule generated in the example can be observed.

**Figure 5.**Structure of the database showing the different natures of the initial data, distinguishing those that are more objectifiable through objective measurements or responses from those that are more subject to interpretation by the pulmonary medical team and the patients themselves.

**Figure 6.**Flowchart of the Intelligent Clinical Decision Support System, showing how the information progresses through three stages. In Stage 1, the initial information is collected and pre-processed; in Stage 2.a, the information compiled by the expert pulmonologists (general information, habits, diseases suffered by the patient and medical drugs taken) is processed; in Stage 2.b the processing of the information related to the symptoms referred by the patient is carried out; in Stage 3, the automated rule generation approach proposed by Wang–Mendel is applied, defining a series of knowledge bases that allow to perform the combination of the risks obtained in the previous stages, making possible to determine a final risk value for each AHI level; and finally, in Stage 4, the risk evaluation and the corresponding decision making are carried out.

**Figure 7.**The cascade of expert systems in detail, showing the different levels the inferential reasoning process has been divided into.

**Figure 8.**Screenshot of the application. Region (1) refers to the collection of the starting information. Region (2) refers to the processing of data. Region (3) refers to the generation of alerts and decision-making.

**Figure 9.**Plot of the ROC curves obtained for each of the AHI thresholds, taking into account the bagged trees algorithm and a 5-fold cross-validation. It can be seen that the area under the curve is greater than 0.8 in each case, with value 1 corresponding to a perfect classifier.

**Figure 10.**ROC curves analysed in the test set and derived from the classifiers of each level of the AHI index after risk aggregation. The red asterisk indicates the point that optimises the classification values obtained after the process of optimising the Matthews coefficient for each case. In all cases, reasonably good curves with AUC values above 0.74 are observed.

**Figure 11.**Determination of optimal cut points for the different inference systems: (

**a**) AHI = 10, (

**b**) AHI = 15, (

**c**) AHI = 20, (

**d**) AHI = 25, and (

**e**) AHI = 30.

**Table 1.**Strengths and weaknesses of previous approaches from the authors’ works and which were used as a grounding for the present proposal. Comparisons are made in terms of the capabilities to formalize and diversify knowledge as well as to deal with uncertainty.

First Proposal [1] | Second Proposal [2] | |
---|---|---|

Formalization and diversification of knowledge | Incorporates a correcting block based on the use of ANFIS and a specific heuristic algorithm, through which a partial formalization of knowledge is carried out. Considers several AHI threshold levels in the prediction, which facilitates the subsequent prioritization of the patients according to the severity of their condition by different types of health professionals. | Formalizes knowledge by using of a cascade of expert systems. Considers a single AHI level, which in some way reduces the subsequent performance of the system and allows only a single threshold to distinguish between patients who suffer from OSA and those who do not. This estimation might be used by the professionals to identify those patients who suffer from the condition. |

Uncertainty management | Performs uncertainty management based on the use of statistical approaches, but without implicit processing of vagueness. | Uses statistical and non-statistical approaches, and therefore performs a more complete management of uncertainty and vagueness. The definition of the method for the union or aggregation of the system risks uses a utility function, which in some way involves increasing the uncertainty associated with the process. |

MATLAB | |

Toolbox | Comments |

App Designer [54] | Facilitates the development of the user graphical interface for the artifact. |

Classification Learner [55] | Allows to perform the training and massive machine learning classification algorithms test. |

Fuzzy Logic Toolbox [56] | Makes possible to implement the fuzzy logic-based inferential engines. |

Python | |

Package | Comments |

Imbalanced-learn library [57] | Provides different tools for addressing classification problems when unbalanced datasets are available. In this case, the SMOTE-NC algorithm is used. |

Threshold | Before SMOTE-NC | After SMOTE-NC | ||||
---|---|---|---|---|---|---|

AHI < Threshold | AHI ≥ Threshold | Total | AHI < Threshold | AHI ≥ Threshold | Total | |

10 | 1227 | 3173 | 4400 | 4000 | 4000 | 8000 |

15 | 1707 | 2693 | 4400 | 4000 | 4000 | 8000 |

20 | 1726 | 2274 | 4400 | 4000 | 4000 | 8000 |

25 | 2072 | 1928 | 4400 | 4000 | 4000 | 8000 |

30 | 2365 | 1635 | 4400 | 4000 | 4000 | 8000 |

**Table 4.**Explanation about the sections of the cascade of expert systems considering the antecedents and consequents of each level [2].

Cascade Levels | Observations |
---|---|

Level 1 | At the first level, four expert systems are used to process the information related to the symptoms reported by the patient (for more information, see Figure 6 and Figure 7). The first of the expert systems is in charge of processing the set of information related to sleep time and determines the risk indicator R1.a at its output. The second of the expert systems focuses on processing the group of information related to unrefreshing sleep, determining the risk indicator R1.b at its output. The third of the expert systems focuses on the group of information related to complicating sleep factors, determining the risk indicator R2.a at its output. Finally, the fourth of the expert systems focuses on the snores information group, determining the risk indicator R2.b at its output. Each one of the determined risk indicators is related to the group of information used for its determination and represents respectively the hazard level associated with suffering from an OSA case in relation to each group of data. |

Level 2 | Once the risk indicators have been determined at the first level of the cascade of expert systems, they are aggregated into groups of two (R1.a and R1.b, as well as R2.a and R.2b) using two new expert systems working concurrently [1,2,4,5,8,10,11,12] as can be seen in Figure 6 and Figure 7, and at their output, after the defuzzification process, determine two new indicators, the risks R1 and R2. These new risk indicators represent, respectively, the danger of suffering from OSA in relation to the risk indicators of the previous level, through which it was possible to determine each of the indicator. |

Level 3 | Finally, at the last level of the cascade, a final expert system aggregates the risk indicators obtained at the second level (R1 and R2), determining at its output an indicator, called Symbolic Risk, related to the conjoint hazard that a patient has of suffering from an OSA case, after contemplating all the symptoms reported by the patient. |

**Table 5.**General configuration of the expert systems used in the cascade [2].

Fuzzy Structure | Mamdani-Type |
---|---|

Defuzzification method | Centroid [48] |

Implication method | Min |

Aggregation method | Max |

Inference System Associated to the Sleep Time Data Group | |||
---|---|---|---|

Input Data | Range | Output Risk | Range |

Hours of sleep | 0–14 h | R1.a | 0–10 |

Minutes until falling asleep | 0–240 min | Initial configuration | |

Fuzzy structure: Mamdani-type. Membership function type: trapezoidal. Defuzzification method: centroid [48]. Implication method: MIN. Aggregation method: MAX. Number of fuzzy rules: 46 | |||

Prolonged intra-sleep awakenings | 0–10 | Subset as an example of the 46 fuzzy rules | |

1. IF (Hours_of_sleep is Few) AND (Minutes_until_falling_asleep is Few) AND (Prolonged_intra-sleep_awakenings is Never) THEN (R1.a is Low). 2. IF (Hours_of_Sleep is Few) AND (Minutes_until_falling_asleep is Few) AND (Prolonged_intra-sleep_awakenings is Never) THEN (R1.a is Medium). | |||

Graphical example of fuzzy rules 1 and 2 | |||

**Table 7.**Example of grid of rules for AHI = 15. The variables mfsy represent the sections of the membership function of the antecedent associated with the Symbolic Risk; The variables mfst represent the sections of the membership function of the antecedent associated with the Statistical Risk; The variables mf represent the sections of the membership function of the consequent associated with the labels of the class ‘OSA case’ or ‘non OSA case’.

Statistical Risk | mfst9 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 |

mfst8 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | |

mfst7 | - | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | |

mfst6 | AR: mf3 | - | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | AR: mf3 | - | |

mfst5 | - | - | - | AR: mf1 | AR: mf3 | AR: mf3 | AR: mf1 | AR: mf3 | AR: mf3 | |

mfst4 | - | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | - | |

mfst3 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | |

mfst2 | - | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | |

mfst1 | - | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | AR: mf1 | |

Apnea Risk (AR) | mfsy1 | mfsy2 | mfsy3 | mfsy4 | mfsy5 | mfsy6 | mfsy7 | mfsy8 | mfsy9 | |

Symbolic Risk |

AHI 10 | AHI 15 | AHI 20 | AHI 25 | AHI 30 | |
---|---|---|---|---|---|

Number of rules | 68 | 71 | 72 | 72 | 71 |

Generated surface |

**Table 9.**Sensitivity and specificity for each AHI level at the output of the system contemplating the cut point that maximizes Mcc.

Sensibility | Specificity | |
---|---|---|

AHI 10 | 0.83 | 0.88 |

AHI 15 | 0.88 | 0.71 |

AHI 20 | 0.93 | 0.62 |

AHI 25 | 0.64 | 0.83 |

AHI 30 | 0.72 | 0.69 |

Data | Value | ||
---|---|---|---|

Objective data | Gender | Man | |

Age | 69 | ||

Weight | 93 kg | ||

Size | 179 cm | ||

BMI | 29.03 | ||

Neck circumference length | 43 cm | ||

Habits | Drinking habits: daily, 30 g of alcohol | ||

Drug treatments | - | ||

Illnesses | - | ||

Subjective data | Sleep time subgroup | Hours of sleep | 8 h |

Minutes until falling asleep | 30 min | ||

Prolonged intra-sleep awakenings | No | ||

Unrefreshing sleep subgroup | Feeling of unrefreshing sleep | Occasionally | |

Daytime tiredness | Occasionally | ||

Morning dullness | No | ||

Complicating sleep factors | Unjustified multiple awakenings | No | |

Nocturia | Occasionally | ||

Breathless awakenings | No | ||

Reported apneas | No | ||

Snores subgroup | Snorer | Yes | |

High-intensity snorer | No | ||

Snore-related awakenings | No | ||

Sleep test | AHI | 23 |

Statistical Risk [0, 100] | Symbolic Risk [0, 100] | |
---|---|---|

AHI = 10 | 70 | 42.86 |

AHI = 15 | 46.67 | 42.86 |

AHI = 20 | 80 | 42.86 |

AHI = 25 | 33.33 | 42.86 |

AHI = 30 | 43.44 | 42.86 |

Ease of Use (Easy/Moderate/Complex) | Automated Knowledge Acquisition (Full/Partial) | Data Dependency (Full/Partial) | Combination of Inference Models (Yes/No) | |
---|---|---|---|---|

Ismail Atacak [65]: This paper proposes a malware detection system for the Android operating system. To this end, six classification machine learning algorithms are first used, focusing on the processing of application data. Then, through a voting process, three of the algorithms are selected, whose results are interpreted and aggregated by a Mamdani-type fuzzy inference system, which makes it possible to determine the degree of malware. | Moderate difficulty of use. To use this system, it is essential to define in advance the knowledge base of the fuzzy inference system that will allow the aggregation of the results of the machine learning algorithms. | Partial knowledge acquisition. The system architecture does not have an automatic knowledge acquisition sub-system. The rules of the Mamdani inference system need to be defined manually. | Full data dependency. This is a data dependent approach as it uses supervised machine learning algorithms. | Yes, it consists of the sequential use of a block of machine learning algorithms and a fuzzy inference system, which can be understood as an ensemble, that is, where the fuzzy engine allows the predictions of the preceding algorithms to be aggregated. |

- | - | = | = | |

Melin et al. [66]: In this work, aimed at predicting the COVID-19 time series, it is proposed to use jointly a block of neural networks, more specifically nonlinear autoregressive neural networks and function fitting neural networks, and a fuzzy inference system focused on determining the importance of the predictions of the models, which are aggregated through a weighted summation model. | Moderate difficulty of use. To use it, it is essential to first define the knowledge base that will allow the importance of each model’s predictions to be determined on the basis of its prediction error. | Partial knowledge acquisition. The system integrates a module based on the Mamdani inference system. Its rules are defined manually, as it does not include a knowledge acquisition subsystem. | Full data dependency. This is an unavoidably data-dependent approach where it is necessary to train the neural networks used. | Yes, this paper uses together both statistical inferential approaches and symbolic inferential approaches. |

- | - | = | = | |

Ahmed et al. [67]: This paper proposes a system for the prediction of diabetes condition. To this end, two machine learning algorithms are used that focus on the processing of initial data, whose predictions are then processed by an inference system based on fuzzy logic of the Mamdani type, which is responsible for determining the final prediction. | Moderate difficulty of use. In order to use this system, it is necessary to first define the knowledge base of the Mamdani inference system, which is essential in determining the prediction of the model. | Partial knowledge acquisition. The knowledge base is manually defined, as the system lacks a knowledge acquisition subsystem. | Full data dependency. As it integrates approaches based on the use of classification machine learning algorithms, the availability of data is essential. | Yes, this system uses both statistical and symbolic inferential approaches in a joint and sequential manner. |

- | - | = | = | |

Ragman et al. [68]: This paper proposes a real-time rainfall forecasting system. To achieve this, it uses four classification machine learning algorithms that focus on the processing of sensor data. The predictions of these models are combined by a Mamdani inference system, which is responsible for determining the final prediction. | Moderately difficult to use. In order to use the system, it is essential to define the knowledge base of the fuzzy inference system responsible for aggregating the predictions. | Partial knowledge acquisition. The system does not have a knowledge acquisition subsystem. The knowledge base is manually defined. | Full data dependency. This is a data dependent approach as it incorporates supervised learning approaches into its architecture. | Yes. It uses statistical and symbolic inference approaches. |

- | - | = | = | |

Casal-Guisande et al. [2]: This is an intelligent decision support system applied to the diagnosis of obstructive sleep apnea. Its architecture uses a set of classification machine learning algorithms and a cascade of expert systems, each of which outputs a risk indicator. These indicators are then combined through a utility function that determines a metric associated with suffering from the pathology. | Moderate difficulty of use. In order to use the intelligent system, it is necessary to have defined the knowledge bases of the different expert systems. In this sense, after this milestone, the system could be used without major difficulties other than those related to the revision and improvement of the rules for its use. | Partial knowledge acquisition. The architecture of the intelligent system, more specifically the cascade of expert systems, does not include a specific knowledge acquisition subsystem. This must be manually defined by the expert team. | Full data dependency. The data is required to train the machine learning classification algorithms. | Yes. It uses symbolic and statistical inference approaches in a concurrent mode. Their results are then combined using a specific utility function. |

- | - | = | = | |

Casal-Guisande et al. [5]: This is an intelligent decision support system applied to the diagnosis of breast cancer, focusing on the interpretation of information obtained from mammograms. Its sequential architecture uses a cascade of expert systems, whose output is a set of risk indicators. A set of underlying factors that summarise and represent the risks is then obtained by applying factor analysis approaches. These are processed by a classification machine learning algorithm, which makes it possible to determine a risk metric associated with suffering from the pathology. | Moderate difficulty of use. The use of the intelligent system requires the definition of the knowledge bases of the different expert systems. In this sense, after this milestone, the system could be used without major difficulties other than those related to the revision and improvement of the rules. | Partial knowledge acquisition. The architecture of the intelligent system, and more specifically the cascade of expert systems, does not contemplate a specific subsystem for acquiring knowledge. The knowledge bases must be defined manually by the expert team. | Full data dependency. Due to its sequential nature and the use of a machine learning classification algorithm, this approach requires a data set from the beginning. | Yes. It uses symbolic and statistical inferential approaches. |

- | - | = | = | |

Casal-Guisande et al. [10]: This paper presents an intelligent system applied to the diagnosis of breast cancer, focusing on the interpretation of the information obtained after performing mammograms. Its architecture uses a set of expert systems and a classification machine learning algorithm working concurrently. The output is a set of risk indicators that are combined using a specific analytical function to obtain a risk indicator. In addition, the system incorporates a corrective approach that allows the weighting of the risk obtained through the opinions of the experts, which is reflected in the BI-RADS indicator. | Moderate difficulty of use. For the use of the intelligent system, it is necessary to define the knowledge bases of the different expert systems. In this sense, after this milestone, the system could be used without major difficulties other than those associated with the revision and improvement of the rules. | Partial knowledge acquisition. There is no subsystem for knowledge acquisition. The knowledge bases of expert systems must be defined manually. | Full data dependency. The system is data dependent due to the use of a classification machine learning algorithm. | Yes, the system integrates various inferential approaches, both symbolic and statistic. |

- | - | = | = | |

Our proposal | Very easy to use. Beyond the definition of the knowledge bases of the cascade of expert systems, it is not necessary to define the rules of the Mamdani inference system responsible for risk aggregation. The system can be used from the beginning without major difficulties. | Full and automatic knowledge acquisition. The system integrates an automatic fuzzy rule generation mechanism, the algorithm proposed by Wang and Mendel. | Full data dependency. In addition to defining the classification machine learning algorithms, data is also needed to create the corpus of rules for the aggregation inference system. | Yes, the system integrates a variety of inference approaches, both symbolic and statistical. |

Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |

© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).

## Share and Cite

**MDPI and ACS Style**

Casal-Guisande, M.; Cerqueiro-Pequeño, J.; Bouza-Rodríguez, J.-B.; Comesaña-Campos, A.
Integration of the Wang & Mendel Algorithm into the Application of Fuzzy Expert Systems to Intelligent Clinical Decision Support Systems. *Mathematics* **2023**, *11*, 2469.
https://doi.org/10.3390/math11112469

**AMA Style**

Casal-Guisande M, Cerqueiro-Pequeño J, Bouza-Rodríguez J-B, Comesaña-Campos A.
Integration of the Wang & Mendel Algorithm into the Application of Fuzzy Expert Systems to Intelligent Clinical Decision Support Systems. *Mathematics*. 2023; 11(11):2469.
https://doi.org/10.3390/math11112469

**Chicago/Turabian Style**

Casal-Guisande, Manuel, Jorge Cerqueiro-Pequeño, José-Benito Bouza-Rodríguez, and Alberto Comesaña-Campos.
2023. "Integration of the Wang & Mendel Algorithm into the Application of Fuzzy Expert Systems to Intelligent Clinical Decision Support Systems" *Mathematics* 11, no. 11: 2469.
https://doi.org/10.3390/math11112469