Fsmpy: A Fuzzy Set Measures Python Library
Abstract
:1. Introduction
2. Design Overview
2.1. Main Module
2.2. Utils Module
- ;
- ;
- .
2.3. Tests Module
3. Applications
3.1. Medical Diagnosis
- ;
- ;
- .
3.2. Text Classification
Algorithm 1. Pseudo-code of the classification algorithm implemented in fsmpy. |
Input: class_patterns, sample_pattern, measure_caller, is_distance = True, return_confidence = False, **kwargs Output: prediction[confidence_degree] |
measures = [] |
for class_pattern in class_patterns do |
measure = measure_caller(sample_pattern, class_pattern, **kwargs) |
measure = measure * (is_distance == True ? 1: −1) |
measures.append(measure) |
end for |
prediction = index_of_min(measures) |
min_measure = measures[prediction] |
other_measures = measures.remove_at(prediction) |
if return_confidence == True then |
return prediction, confidence_degree(min_measure, other_measures) |
else |
return prediction |
end if |
3.3. Image Segmentation
4. Availability
5. Conclusions
- Implementation of additional measures (distance, similarity and other types), classifiers and membership value calculation functions.
- Further study of the implemented measures and their tests.
- Additional tools useful for the development of novel measures (such as the testing of theorems).
- Extension of library application and utility functions.
Author Contributions
Funding
Institutional Review Board Statement
Informed Consent Statement
Data Availability Statement
Acknowledgments
Conflicts of Interest
References
- Zadeh, L.A. Fuzzy Sets. Inf. Control. 1965, 8, 338–353. [Google Scholar] [CrossRef] [Green Version]
- Atanassov, K.T. Intuitionistic Fuzzy Sets. Fuzzy Sets Syst. 1986, 20, 87–96. [Google Scholar] [CrossRef]
- Chaira, T.; Ray, A.K. Threshold Selection Using Fuzzy Set Theory. Pattern Recognit. Lett. 2004, 25, 865–874. [Google Scholar] [CrossRef]
- Bouchet, A.; Montes, S.; Ballarin, V.; Díaz, I. Intuitionistic Fuzzy Set and Fuzzy Mathematical Morphology Applied to Color Leukocytes Segmentation. SIViP 2020, 14, 557–564. [Google Scholar] [CrossRef]
- Chaira, T. Intuitionistic Fuzzy Approach for Enhancement of Low Contrast Mammogram Images. Int. J. Imaging Syst. Technol. 2020, 30, 1162–1172. [Google Scholar] [CrossRef]
- Pei, Z.; Zheng, L. A Novel Approach to Multi-Attribute Decision Making Based on Intuitionistic Fuzzy Sets. Expert Syst. Appl. 2012, 39, 2560–2566. [Google Scholar] [CrossRef]
- Stanujkić, D.; Karabašević, D. An Extension of the WASPAS Method for Decision-Making Problems with Intuitionistic Fuzzy Numbers: A Case of Website Evaluation. Oper. Res. Eng. Sci. Theor. Appl. 2019, 1, 29–39. [Google Scholar] [CrossRef]
- Şahïn, M.; Uluçay, V. Fuzzy Soft Expert Graphs with Application. Asian J. Math. Comput. Res. 2019, 26, 216–229. [Google Scholar]
- Baccour, L.; Kanoun, S.; Märgner, V.; Alimi, A. An Application of Intuitionistic Fuzzy Information for Handwritten Arabic Word Recognition. In Proceedings of the 12th International Conference on IFSs (NIFS08), Sofia, Bulgaria, 17–18 May 2008. [Google Scholar]
- Gau, W.-L.; Buehrer, D.J. Vague Sets. IEEE Trans. Syst. Man. Cybern. 1993, 23, 610–614. [Google Scholar] [CrossRef]
- Bustince, H.; Burillo, P. Vague Sets Are Intuitionistic Fuzzy Sets. Fuzzy Sets Syst. 1996, 79, 403–405. [Google Scholar] [CrossRef]
- Uluçay, V.; Deli, I.; Şahin, M. Intuitionistic Trapezoidal Fuzzy Multi-Numbers and Its Application to Multi-Criteria Decision-Making Problems. Complex Intell. Syst. 2019, 5, 65–78. [Google Scholar] [CrossRef] [Green Version]
- Alkhazaleh, S.; Salleh, A.R. Fuzzy Soft Expert Set and Its Application. AM 2014, 05, 1349–1368. [Google Scholar] [CrossRef] [Green Version]
- Szmidt, E.; Kacprzyk, J. Distances between Intuitionistic Fuzzy Sets. Fuzzy Sets Syst. 2000, 114, 505–518. [Google Scholar] [CrossRef]
- Grzegorzewski, P. Distances between Intuitionistic Fuzzy Sets and/or Interval-Valued Fuzzy Sets Based on the Hausdorff Metric. Fuzzy Sets Syst. 2004, 148, 319–328. [Google Scholar] [CrossRef]
- Vlachos, I.K.; Sergiadis, G.D. Intuitionistic Fuzzy Information—Applications to Pattern Recognition. Pattern Recognit. Lett. 2007, 28, 197–206. [Google Scholar] [CrossRef]
- Hong, D.H.; Kim, C. A Note on Similarity Measures between Vague Sets and between Elements. Inf. Sci. 1999, 115, 83–96. [Google Scholar] [CrossRef]
- Dengfeng, L.; Chuntian, C. New Similarity Measures of Intuitionistic Fuzzy Sets and Application to Pattern Recognitions. Pattern Recognit. Lett. 2002, 23, 221–225. [Google Scholar] [CrossRef]
- Mitchell, H.B. On the Dengfeng–Chuntian Similarity Measure and Its Application to Pattern Recognition. Pattern Recognit. Lett. 2003, 24, 3101–3104. [Google Scholar] [CrossRef]
- Papakostas, G.A.; Hatzimichailidis, A.G.; Kaburlasos, V.G. Distance and Similarity Measures between Intuitionistic Fuzzy Sets: A Comparative Analysis from a Pattern Recognition Point of View. Pattern Recognit. Lett. 2013, 34, 1609–1622. [Google Scholar] [CrossRef]
- Atanassov, K.T. Review and New Results on Intuitionistic Fuzzy Sets. Int. J. Bioautomation 2016, 20, S17–S26. [Google Scholar]
- Kahraman, C.; Oztaysi, B.; Onar, S.C.; Otay, I. A Literature Review on the Extensions of Intuitionistic Fuzzy Sets. In Proceedings of the Developments of Artificial Intelligence Technologies in Computation and Robotics, Cologne, Germany, 18–21 August 2020; World Scientific: Cologne, Germany, 2020; pp. 199–207. [Google Scholar]
- Abadi, M.; Barham, P.; Chen, J.; Chen, Z.; Davis, A.; Dean, J.; Devin, M.; Ghemawat, S.; Irving, G.; Isard, M.; et al. TensorFlow: A System for Large-Scale Machine Learning. In Proceedings of the 12th USENIX Symposium on Operating Systems Design and Implementation (OSDI’16), Savannah, GA, USA, 2–4 November 2016; pp. 265–283. [Google Scholar]
- Paszke, A.; Gross, S.; Massa, F.; Lerer, A.; Bradbury, J.; Chanan, G.; Killeen, T.; Lin, Z.; Gimelshein, N.; Antiga, L.; et al. PyTorch: An Imperative Style, High-Performance Deep Learning Library. arXiv 2019, arXiv:1912.01703. [Google Scholar]
- Naveenkumar, M.; Vadivel, A. OpenCV for Computer Vision Applications. In Proceedings of the National Conference on Big Data and Cloud Computing (NCBDC’15), Jeju Island, Korea, 9–11 February 2015; pp. 52–56. [Google Scholar]
- Lenz, O.U.; Peralta, D.; Cornelis, C. Fuzzy-Rough-Learn 0.1: A Python Library for Machine Learning with Fuzzy Rough Sets. In Rough Sets; Bello, R., Miao, D., Falcon, R., Nakata, M., Rosete, A., Ciucci, D., Eds.; Lecture Notes in Computer Science; Springer International Publishing: Cham, Switzerland, 2020; Volume 12179, pp. 491–499. ISBN 978-3-030-52704-4. [Google Scholar]
- Pedregosa, F.; Varoquaux, G.; Gramfort, A.; Michel, V.; Thirion, B.; Grisel, O.; Blondel, M.; Müller, A.; Nothman, J.; Louppe, G.; et al. Scikit-Learn: Machine Learning in Python. arXiv 2018, arXiv:1201.0490. [Google Scholar]
- McCulloch, J. Fuzzycreator: A Python-Based Toolkit for Automatically Generating and Analysing Data-Driven Fuzzy Sets. In Proceedings of the 2017 IEEE International Conference on Fuzzy Systems (FUZZ-IEEE), Naples, Italy, 9 July 2017; pp. 1–6. [Google Scholar]
- Topal, S.; Broumi, S.; Bakali, A.; Talea, M.; Smarandache, F. A Python Tool for Implementations on Bipolar Neutrosophic Matrices; Zenodo: Genève, Switzerland, 2019. [Google Scholar] [CrossRef]
- Broumi, S.; Topal, S.; Bakali, A.; Talea, M.; Smarandache, F. A Novel Python Toolbox for Single and Interval-Valued Neutrosophic Matrices: In Advances in Logistics, Operations, and Management Science; Abdel-Basset, M., Smarandache, F., Eds.; IGI Global: Hershey, PA, USA, 2020; pp. 281–330. ISBN 978-1-79982-555-5. [Google Scholar]
- Harris, C.R.; Millman, K.J.; van der Walt, S.J.; Gommers, R.; Virtanen, P.; Cournapeau, D.; Wieser, E.; Taylor, J.; Berg, S.; Smith, N.J.; et al. Array Programming with NumPy. Nature 2020, 585, 357–362. [Google Scholar] [CrossRef] [PubMed]
- Deng, G.; Jiang, Y.; Fu, J. Monotonic Similarity Measures between Intuitionistic Fuzzy Sets and Their Relationship with Entropy and Inclusion Measure. Inf. Sci. 2015, 316, 348–369. [Google Scholar] [CrossRef]
- Iancu, I. Intuitionistic Fuzzy Similarity Measures Based on Frank T-Norms Family. Pattern Recognit. Lett. 2014, 42, 128–136. [Google Scholar] [CrossRef]
- Muthukumar, P.; Sai Sundara Krishnan, G. A Similarity Measure of Intuitionistic Fuzzy Soft Sets and Its Application in Medical Diagnosis. Appl. Soft Comput. 2016, 41, 148–156. [Google Scholar] [CrossRef]
- Nguyen, H. A Novel Similarity/Dissimilarity Measure for Intuitionistic Fuzzy Sets and Its Application in Pattern Recognition. Expert Syst. Appl. 2016, 45, 97–107. [Google Scholar] [CrossRef]
- Song, Y.; Wang, X.; Lei, L.; Xue, A. A Novel Similarity Measure on Intuitionistic Fuzzy Sets with Its Applications. Appl. Intell. 2015, 42, 252–261. [Google Scholar] [CrossRef]
- Chen, S.-M.; Cheng, S.-H.; Lan, T.-C. A Novel Similarity Measure between Intuitionistic Fuzzy Sets Based on the Centroid Points of Transformed Fuzzy Numbers with Applications to Pattern Recognition. Inf. Sci. 2016, 343–344, 15–40. [Google Scholar] [CrossRef]
- Intarapaiboon, P. A Hierarchy-Based Similarity Measure for Intuitionistic Fuzzy Sets. Soft Comput. 2016, 20, 1909–1919. [Google Scholar] [CrossRef]
- Fan, J.; Xie, W. Distance Measure and Induced Fuzzy Entropy. Fuzzy Sets Syst. 1999, 104, 305–314. [Google Scholar] [CrossRef]
- Shyi-Ming Chen Measures of Similarity between Vague Sets. Fuzzy Sets Syst. 1995, 74, 217–223. [CrossRef]
- Shyi-Ming Chen Similarity Measures between Vague Sets and between Elements. IEEE Trans. Syst. Man Cybern. B 1997, 27, 153–158. [CrossRef] [PubMed]
- Hung, W.-L.; Yang, M.-S. Similarity Measures of Intuitionistic Fuzzy Sets Based on Hausdorff Distance. Pattern Recognit. Lett. 2004, 25, 1603–1611. [Google Scholar] [CrossRef]
- Hung, W.-L.; Yang, M.-S. On the J-Divergence of Intuitionistic Fuzzy Sets with Its Application to Pattern Recognition. Inf. Sci. 2008, 178, 1641–1650. [Google Scholar] [CrossRef]
- Hung, W.-L.; Yang, M.-S. On Similarity Measures between Intuitionistic Fuzzy Sets. Int. J. Intell. Syst. 2008, 23, 364–383. [Google Scholar] [CrossRef]
- Hung, W.-L.; Yang, M.-S. Similarity Measures of Intuitionistic Fuzzy Sets Based on Lp Metric. Int. J. Approx. Reason. 2007, 46, 120–136. [Google Scholar] [CrossRef] [Green Version]
- Hwang, C.-M.; Yang, M.-S. Modified Cosine Similarity Measure between Intuitionistic Fuzzy Sets. In Artificial Intelligence and Computational Intelligence; Lei, J., Wang, F.L., Deng, H., Miao, D., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2012; Volume 7530, pp. 285–293. ISBN 978-3-642-33477-1. [Google Scholar]
- Liang, Z.; Shi, P. Similarity Measures on Intuitionistic Fuzzy Sets. Pattern Recognit. Lett. 2003, 24, 2687–2693. [Google Scholar] [CrossRef]
- Liu, H.-W. New Similarity Measures between Intuitionistic Fuzzy Sets and between Elements. Math. Comput. Model. 2005, 42, 61–70. [Google Scholar] [CrossRef]
- Julian, P.; Hung, K.-C.; Lin, S.-J. On the Mitchell Similarity Measure and Its Application to Pattern Recognition. Pattern Recognit. Lett. 2012, 33, 1219–1223. [Google Scholar] [CrossRef]
- Ye, J. Cosine Similarity Measures for Intuitionistic Fuzzy Sets and Their Applications. Math. Comput. Model. 2011, 53, 91–97. [Google Scholar] [CrossRef]
- Zhang, C.; Fu, H. Similarity Measures on Three Kinds of Fuzzy Sets. Pattern Recognit. Lett. 2006, 27, 1307–1317. [Google Scholar] [CrossRef]
- Wang, W.; Xin, X. Distance Measure between Intuitionistic Fuzzy Sets. Pattern Recognit. Lett. 2005, 26, 2063–2069. [Google Scholar] [CrossRef]
- Yang, Y.; Chiclana, F. Consistency of 2D and 3D Distances of Intuitionistic Fuzzy Sets. Expert Syst. Appl. 2012, 39, 8665–8670. [Google Scholar] [CrossRef]
- Intarapaiboon, P. Text Classification Using Similarity Measures on Intuitionistic Fuzzy Sets. ScienceAsia 2016, 42, 52. [Google Scholar] [CrossRef] [Green Version]
- Hatzimichailidis, A.G.; Papakostas, G.A.; Kaburlasos, V.G. A Novel Distance Measure of Intuitionistic Fuzzy Sets and Its Application to Pattern Recognition Problems. Int. J. Intell. Syst. 2012, 27, 396–409. [Google Scholar] [CrossRef]
- Greene, D.; Cunningham, P. Producing Accurate Interpretable Clusters from High-Dimensional Data. In Knowledge Discovery in Databases: PKDD 2005; Jorge, A.M., Torgo, L., Brazdil, P., Camacho, R., Gama, J., Eds.; Lecture Notes in Computer Science; Springer: Berlin/Heidelberg, Germany, 2005; Volume 3721, pp. 486–494. ISBN 978-3-540-29244-9. [Google Scholar]
Authors’ Names | Similarity Method | Parameters | Functions in Corresponding Paper | Reference |
---|---|---|---|---|
S. M. Chen | chen_1 | weights | [40] | |
S. M. Chen | chen_2 | weights, a, b, c | [41] | |
S.M. Chen, S. Cheng, T. C. Lan | chen_cheng_lan | weights | [37] | |
G. Deng, Y. Jiang, J. Fu | deng_jiang_fu | weights, similarity_type, p, u, v | - | [32] |
L. Dengfeng, C. Chuntian | dengfeng_chuntian | p, weights | [18] | |
D.H. Hong, C.Kim | hong_kim | weights, a, b, c | [17] | |
W.L. Hung, M.S. Yang | hung_yang_1 | similarity_type, weights | [42] | |
W.L. Hung, M.S. Yang | hung_yang_2 | similarity_type, a | [43] | |
W.L. Hung, M.S. Yang | hung_yang_3 | similarity_type | [44] | |
W.L. Hung, M.S. Yang | hung_yang_4 | similarity_type, p | [45] | |
C.M. Hwang, M.S. Yang | hwang_yang | - | [46] | |
I. Iancu | iancu | similarity_type, lamda | , | [33] |
P. Intarapaiboon | intarapaiboon | - | [38] | |
Z. Liang, P. Shi | liang_shi | similarity_type, p, weights, omegas | [47] | |
H.W. Liu | liu | p, weights, a, b, c | [48] | |
H.B. Mitchell | mitchell | p, weights | [19] | |
P. Muthukumar, G. S. S. Krishnan | muthukumar_krishnanb | weights | [34] | |
H. Nguyen | nguyen | - | [35] | |
S. Park, Y.C. Kwun, K.M. Lim | park_kwun_lim | p, weights | ||
Y. Song, X. Wang, L. Lei, Xue | song_wang_lei_xue | weights | [36] | |
P. Julian, K.C. Hung, S. Lin | vulian_hung_lin | similarity_type, p, weights | [49] | |
Ye | Ye | weights | [50] | |
C. Zhang, H. Fu | zhang_fu | - | [51] |
Authors’ Names | Similarity Method | Parameters | Functions in Corresponding Paper | Reference |
---|---|---|---|---|
K.T. Atanassov | atanassov | distance_type | [2] | |
E. Szmidt, A. Kacprzyk | szmidt_kacprzyk | distance_type | [14] | |
W. Wang, X. Xin | wang_xin | distance_type, weights, p | [52] | |
Y. Yang, F. Chiclana | yang_chiclana | distance_type | [53] | |
P. Grzegorzewski | grzegorzewski | distance_type | [15] | |
I.K. Vlachos, G.D. Sergiadis | vlachos_sergiadis | - | [16] |
Authors’ Names | Similarity Method | Parameters | Functions in Corresponding Paper | Reference |
---|---|---|---|---|
J. Fan, W. Xie | fuzzy_divergence | [39] | ||
T. Chaira, A.K. Ray | fuzzy_index | A, d | [3] |
Viral Fever | Malaria | Typhoid | Stomach Problem | Chest Pain | |
---|---|---|---|---|---|
Temperature | (0.4, 0.0) | (0.7, 0.0) | (0.3, 0.3) | (0.1, 0.7) | (0.1, 0.8) |
Headache | (0.3, 0.5) | (0.2, 0.6) | (0.6, 0.1) | (0.2, 0.4) | (0.0, 0.8) |
Stomach pain | (0.1, 0.7) | (0.0, 0.9) | (0.2, 0.7) | (0.8, 0.0) | (0.2, 0.8) |
Cough | (0.4, 0.3) | (0.7, 0.0) | (0.2, 0.6) | (0.2, 0.7) | (0.2, 0.8) |
Chest pain | (0.1, 0.7) | (0.1, 0.8) | (0.1, 0.9) | (0.2, 0.7) | (0.8, 0.1) |
Temperature | Headache | Stomach Pain | Cough | Chest Pain | |
---|---|---|---|---|---|
Al | (0.8, 0.1) | (0.6, 0.1) | (0.2, 0.8) | (0.6, 0.1) | (0.1, 0.6) |
Bob | (0.0, 0.8) | (0.4, 0.4) | (0.6, 0.1) | (0.1, 0.7) | (0.1, 0.8) |
Joe | (0.8, 0.1) | (0.8, 0.1) | (0.0, 0.6) | (0.2, 0.7) | (0.0, 0.5) |
Ted | (0.6, 0.1) | (0.5, 0.4) | (0.3, 0.4) | (0.7, 0.2) | (0.3, 0.4) |
Predicted Diagnosis | Degree of Confidence | |
---|---|---|
Al | Malaria | 3.15 |
Bob | Stomach problem | 5.05 |
Joe | Typhoid | 3.55 |
Ted | Viral fever | 2.70 |
Original Parameters (p = 2) | Optimized Hyper Parameters (p = 3) | |
---|---|---|
F1 | 93.2 | 95.2 |
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 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
Sidiropoulos, G.K.; Apostolidis, K.D.; Damianos, N.; Papakostas, G.A. Fsmpy: A Fuzzy Set Measures Python Library. Information 2022, 13, 64. https://doi.org/10.3390/info13020064
Sidiropoulos GK, Apostolidis KD, Damianos N, Papakostas GA. Fsmpy: A Fuzzy Set Measures Python Library. Information. 2022; 13(2):64. https://doi.org/10.3390/info13020064
Chicago/Turabian StyleSidiropoulos, George K., Kyriakos D. Apostolidis, Nikolaos Damianos, and George A. Papakostas. 2022. "Fsmpy: A Fuzzy Set Measures Python Library" Information 13, no. 2: 64. https://doi.org/10.3390/info13020064
APA StyleSidiropoulos, G. K., Apostolidis, K. D., Damianos, N., & Papakostas, G. A. (2022). Fsmpy: A Fuzzy Set Measures Python Library. Information, 13(2), 64. https://doi.org/10.3390/info13020064