pyfdm 1.0.1__zip
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- Program Files/Lib/site-packages/pyfdm/__init__.py +4 -0
- Program Files/Lib/site-packages/pyfdm/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/__pycache__/correlations.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/__pycache__/helpers.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/__pycache__/weights.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/correlations.py +92 -0
- Program Files/Lib/site-packages/pyfdm/helpers.py +62 -0
- Program Files/Lib/site-packages/pyfdm/methods/__init__.py +11 -0
- Program Files/Lib/site-packages/pyfdm/methods/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/__pycache__/f_aras.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/__pycache__/f_codas.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/__pycache__/f_copras.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/__pycache__/f_edas.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/__pycache__/f_mabac.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/__pycache__/f_mairca.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/__pycache__/f_moora.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/__pycache__/f_ocra.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/__pycache__/f_topsis.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/__pycache__/f_vikor.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/__pycache__/validator.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/aras/__init__.py +1 -0
- Program Files/Lib/site-packages/pyfdm/methods/aras/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/aras/__pycache__/fuzzy.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/aras/fuzzy.py +50 -0
- Program Files/Lib/site-packages/pyfdm/methods/codas/__init__.py +1 -0
- Program Files/Lib/site-packages/pyfdm/methods/codas/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/codas/__pycache__/fuzzy.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/codas/fuzzy.py +92 -0
- Program Files/Lib/site-packages/pyfdm/methods/copras/__init__.py +1 -0
- Program Files/Lib/site-packages/pyfdm/methods/copras/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/copras/__pycache__/fuzzy.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/copras/fuzzy.py +54 -0
- Program Files/Lib/site-packages/pyfdm/methods/edas/__init__.py +1 -0
- Program Files/Lib/site-packages/pyfdm/methods/edas/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/edas/__pycache__/fuzzy.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/edas/fuzzy.py +80 -0
- Program Files/Lib/site-packages/pyfdm/methods/f_aras.py +47 -0
- Program Files/Lib/site-packages/pyfdm/methods/f_codas.py +59 -0
- Program Files/Lib/site-packages/pyfdm/methods/f_copras.py +47 -0
- Program Files/Lib/site-packages/pyfdm/methods/f_edas.py +47 -0
- Program Files/Lib/site-packages/pyfdm/methods/f_mabac.py +52 -0
- Program Files/Lib/site-packages/pyfdm/methods/f_mairca.py +52 -0
- Program Files/Lib/site-packages/pyfdm/methods/f_moora.py +47 -0
- Program Files/Lib/site-packages/pyfdm/methods/f_ocra.py +47 -0
- Program Files/Lib/site-packages/pyfdm/methods/f_topsis.py +52 -0
- Program Files/Lib/site-packages/pyfdm/methods/f_vikor.py +51 -0
- Program Files/Lib/site-packages/pyfdm/methods/fuzzy_sets/__init__.py +1 -0
- Program Files/Lib/site-packages/pyfdm/methods/fuzzy_sets/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/fuzzy_sets/tfn/__init__.py +3 -0
- Program Files/Lib/site-packages/pyfdm/methods/fuzzy_sets/tfn/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/fuzzy_sets/tfn/__pycache__/defuzzifications.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/fuzzy_sets/tfn/__pycache__/distances.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/fuzzy_sets/tfn/__pycache__/normalizations.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/fuzzy_sets/tfn/defuzzifications.py +86 -0
- Program Files/Lib/site-packages/pyfdm/methods/fuzzy_sets/tfn/distances.py +173 -0
- Program Files/Lib/site-packages/pyfdm/methods/fuzzy_sets/tfn/normalizations.py +188 -0
- Program Files/Lib/site-packages/pyfdm/methods/mabac/__init__.py +1 -0
- Program Files/Lib/site-packages/pyfdm/methods/mabac/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/mabac/__pycache__/fuzzy.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/mabac/fuzzy.py +51 -0
- Program Files/Lib/site-packages/pyfdm/methods/mairca/__init__.py +1 -0
- Program Files/Lib/site-packages/pyfdm/methods/mairca/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/mairca/__pycache__/fuzzy.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/mairca/fuzzy.py +57 -0
- Program Files/Lib/site-packages/pyfdm/methods/moora/__init__.py +1 -0
- Program Files/Lib/site-packages/pyfdm/methods/moora/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/moora/__pycache__/fuzzy.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/moora/fuzzy.py +47 -0
- Program Files/Lib/site-packages/pyfdm/methods/ocra/__init__.py +1 -0
- Program Files/Lib/site-packages/pyfdm/methods/ocra/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/ocra/__pycache__/fuzzy.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/ocra/fuzzy.py +52 -0
- Program Files/Lib/site-packages/pyfdm/methods/topsis/__init__.py +1 -0
- Program Files/Lib/site-packages/pyfdm/methods/topsis/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/topsis/__pycache__/fuzzy.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/topsis/fuzzy.py +56 -0
- Program Files/Lib/site-packages/pyfdm/methods/validator.py +133 -0
- Program Files/Lib/site-packages/pyfdm/methods/vikor/__init__.py +1 -0
- Program Files/Lib/site-packages/pyfdm/methods/vikor/__pycache__/__init__.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/vikor/__pycache__/fuzzy.cpython-310.pyc +0 -0
- Program Files/Lib/site-packages/pyfdm/methods/vikor/fuzzy.py +77 -0
- Program Files/Lib/site-packages/pyfdm/weights.py +100 -0
- Program Files/Lib/site-packages/pyfdm-1.0.1-py3.10.egg-info/PKG-INFO +196 -0
- Program Files/Lib/site-packages/pyfdm-1.0.1-py3.10.egg-info/SOURCES.txt +49 -0
- Program Files/Lib/site-packages/pyfdm-1.0.1-py3.10.egg-info/dependency_links.txt +1 -0
- Program Files/Lib/site-packages/pyfdm-1.0.1-py3.10.egg-info/requires.txt +2 -0
- Program Files/Lib/site-packages/pyfdm-1.0.1-py3.10.egg-info/top_level.txt +1 -0
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# Copyright (c) 2022 Jakub Więckowski
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
|
|
5
|
+
def fuzzy(matrix, weights, types, defuzzify, v):
|
|
6
|
+
"""
|
|
7
|
+
Calculates the alternatives preferences based on Triangular Fuzzy Number extension
|
|
8
|
+
|
|
9
|
+
Parameters
|
|
10
|
+
----------
|
|
11
|
+
matrix : ndarray
|
|
12
|
+
Decision matrix / alternatives data.
|
|
13
|
+
Alternatives are in rows and Criteria are in columns.
|
|
14
|
+
|
|
15
|
+
weights : ndarray
|
|
16
|
+
Vector of criteria weights in a crisp form
|
|
17
|
+
|
|
18
|
+
types : ndarray
|
|
19
|
+
Types of criteria, 1 profit, -1 cost
|
|
20
|
+
|
|
21
|
+
defuzzify: callable
|
|
22
|
+
Function used to defuzzify the TFN into crisp value
|
|
23
|
+
|
|
24
|
+
v : float
|
|
25
|
+
Weight of the strategy (see VIKOR algorithm explanation).
|
|
26
|
+
|
|
27
|
+
Returns
|
|
28
|
+
-------
|
|
29
|
+
ndarray:
|
|
30
|
+
Crisp preferences of alternatives
|
|
31
|
+
|
|
32
|
+
"""
|
|
33
|
+
|
|
34
|
+
# ideal and nadir values
|
|
35
|
+
ideal, nadir = np.zeros((matrix.shape[1], 3)), np.zeros(
|
|
36
|
+
(matrix.shape[1], 3))
|
|
37
|
+
for j in range(matrix.shape[1]):
|
|
38
|
+
if types[j] == 1:
|
|
39
|
+
ideal[j] = np.max(matrix[:, j], axis=0)
|
|
40
|
+
nadir[j] = np.min(matrix[:, j], axis=0)
|
|
41
|
+
else:
|
|
42
|
+
ideal[j] = np.min(matrix[:, j], axis=0)
|
|
43
|
+
nadir[j] = np.max(matrix[:, j], axis=0)
|
|
44
|
+
|
|
45
|
+
# normalized fuzzy difference
|
|
46
|
+
d = np.zeros(matrix.shape)
|
|
47
|
+
for i in range(matrix.shape[0]):
|
|
48
|
+
for j in range(matrix.shape[1]):
|
|
49
|
+
if types[j] == 1:
|
|
50
|
+
d[i, j] = (ideal[j] - np.flipud(matrix[i, j])) / \
|
|
51
|
+
(ideal[j, 2] - nadir[j, 0])
|
|
52
|
+
else:
|
|
53
|
+
d[i, j] = (matrix[i, j] - np.flipud(ideal[j])) / \
|
|
54
|
+
(nadir[j, 2] - ideal[j, 0])
|
|
55
|
+
|
|
56
|
+
if weights.ndim == 1:
|
|
57
|
+
weights = np.repeat(weights, 3).reshape((len(weights), 3))
|
|
58
|
+
|
|
59
|
+
# S, R, Q rankings
|
|
60
|
+
S, R, Q = np.zeros((matrix.shape[0], 3)), np.zeros(
|
|
61
|
+
(matrix.shape[0], 3)), np.zeros((matrix.shape[0], 3))
|
|
62
|
+
|
|
63
|
+
for i in range(matrix.shape[0]):
|
|
64
|
+
S[i] = np.sum(d[i, :] * weights, axis=0)
|
|
65
|
+
R[i] = np.max(d[i, :] * weights, axis=0)
|
|
66
|
+
|
|
67
|
+
for i in range(matrix.shape[0]):
|
|
68
|
+
Q[i] = v * (S[i] - np.flipud(np.min(S, axis=0)))/(np.max(S, axis=0)[2] - np.min(S, axis=0)[0]) + \
|
|
69
|
+
(1-v)*(R[i] - np.flipud(np.min(R, axis=0))) / \
|
|
70
|
+
(np.max(R, axis=0)[2] - np.min(R, axis=0)[0])
|
|
71
|
+
|
|
72
|
+
# defuzzification
|
|
73
|
+
crisp_S = np.array([defuzzify(s) for s in S])
|
|
74
|
+
crisp_R = np.array([defuzzify(r) for r in R])
|
|
75
|
+
crisp_Q = np.array([defuzzify(q) for q in Q])
|
|
76
|
+
|
|
77
|
+
return crisp_S, crisp_R, crisp_Q
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
# Copyright (c) 2022 Jakub Więckowski
|
|
2
|
+
|
|
3
|
+
import numpy as np
|
|
4
|
+
|
|
5
|
+
__all__ = [
|
|
6
|
+
'equal_weights',
|
|
7
|
+
'shannon_entropy_weights',
|
|
8
|
+
'standard_deviation_weights',
|
|
9
|
+
'variance_weights'
|
|
10
|
+
]
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def equal_weights(matrix):
|
|
14
|
+
"""
|
|
15
|
+
Calculates the objective weights for Triangular Fuzzy Matrix, each weight will have the same value
|
|
16
|
+
|
|
17
|
+
Parameters
|
|
18
|
+
----------
|
|
19
|
+
matrix: ndarray
|
|
20
|
+
Decision matrix / alternatives data
|
|
21
|
+
Alternatives are in rows and Criteria are in columns
|
|
22
|
+
|
|
23
|
+
Returns
|
|
24
|
+
-------
|
|
25
|
+
ndarray
|
|
26
|
+
Array of equal weights
|
|
27
|
+
"""
|
|
28
|
+
|
|
29
|
+
w = np.ones(matrix.shape[1]) / matrix.shape[1]
|
|
30
|
+
return np.repeat(w, 3).reshape((len(w), 3))
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
def shannon_entropy_weights(matrix):
|
|
34
|
+
"""
|
|
35
|
+
Calculates the objective weights for Triangular Fuzzy Matrix, weight depend on the entropy measure in the column
|
|
36
|
+
|
|
37
|
+
Parameters
|
|
38
|
+
----------
|
|
39
|
+
matrix: ndarray
|
|
40
|
+
Decision matrix / alternatives data
|
|
41
|
+
Alternatives are in rows and Criteria are in columns
|
|
42
|
+
|
|
43
|
+
Returns
|
|
44
|
+
-------
|
|
45
|
+
ndarray
|
|
46
|
+
Array of weights based on matrix entropy
|
|
47
|
+
"""
|
|
48
|
+
# https://www.mdpi.com/1099-4300/19/7/373/htm
|
|
49
|
+
|
|
50
|
+
# shannon entropy vector
|
|
51
|
+
e = np.zeros((matrix.shape[1], 3))
|
|
52
|
+
for j in range(matrix.shape[1]):
|
|
53
|
+
e[j] = - 1/(np.log(matrix.shape[0])) * \
|
|
54
|
+
np.sum(matrix[:, j] * np.log(matrix[:, j]), axis=0)
|
|
55
|
+
|
|
56
|
+
# fuzzy diversification vector
|
|
57
|
+
d = 1 - e
|
|
58
|
+
|
|
59
|
+
# fuzzy criteria weights
|
|
60
|
+
w = d / np.sum(d, axis=0)
|
|
61
|
+
|
|
62
|
+
return w
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
def standard_deviation_weights(matrix):
|
|
66
|
+
"""
|
|
67
|
+
Calculates the objective weights for Triangular Fuzzy Matrix, weight depend on the data standard deviation in the column
|
|
68
|
+
|
|
69
|
+
Parameters
|
|
70
|
+
----------
|
|
71
|
+
matrix: ndarray
|
|
72
|
+
Decision matrix / alternatives data
|
|
73
|
+
Alternatives are in rows and Criteria are in columns
|
|
74
|
+
|
|
75
|
+
Returns
|
|
76
|
+
-------
|
|
77
|
+
ndarray
|
|
78
|
+
Array of weights based on matrix entropy
|
|
79
|
+
"""
|
|
80
|
+
w = np.std(matrix, axis=0)
|
|
81
|
+
return w / np.sum(w, axis=0)
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
def variance_weights(matrix):
|
|
85
|
+
"""
|
|
86
|
+
Calculates the objective weights for Triangular Fuzzy Matrix, weight depend on the data variance in the column
|
|
87
|
+
|
|
88
|
+
Parameters
|
|
89
|
+
----------
|
|
90
|
+
matrix: ndarray
|
|
91
|
+
Decision matrix / alternatives data
|
|
92
|
+
Alternatives are in rows and Criteria are in columns
|
|
93
|
+
|
|
94
|
+
Returns
|
|
95
|
+
-------
|
|
96
|
+
ndarray
|
|
97
|
+
Array of weights based on matrix entropy
|
|
98
|
+
"""
|
|
99
|
+
w = np.var(matrix, axis=0)
|
|
100
|
+
return w / np.sum(w, axis=0)
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: pyfdm
|
|
3
|
+
Version: 1.0.1
|
|
4
|
+
Summary: Python library for Fuzzy Decision Making
|
|
5
|
+
Home-page: https://github.com/jwieckowski/pyfdm
|
|
6
|
+
Author: Jakub Więckowski
|
|
7
|
+
Author-email: jakub-wieckowski@zut.edu.pl
|
|
8
|
+
Classifier: Programming Language :: Python :: 3
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Operating System :: OS Independent
|
|
11
|
+
Requires-Python: >=3.7
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
|
|
15
|
+
# pyfdm
|
|
16
|
+
|
|
17
|
+
Python 3 package with Fuzzy Decision Making (PyFDM) methods based on Triangular Fuzzy Numbers (TFN)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
# Installation
|
|
22
|
+
|
|
23
|
+
The package can be download using pip:
|
|
24
|
+
|
|
25
|
+
```Bash
|
|
26
|
+
pip install pyfdm
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
# Testing
|
|
30
|
+
|
|
31
|
+
The modules performance can be verified with pytest library
|
|
32
|
+
|
|
33
|
+
```Bash
|
|
34
|
+
pip install pytest
|
|
35
|
+
pytest tests
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
# Modules and functionalities
|
|
41
|
+
|
|
42
|
+
- Fuzzy MCDA methods:
|
|
43
|
+
|
|
44
|
+
| Abbreviation | Full name | Reference |
|
|
45
|
+
| ------------ | ------------------------------------------------------------------------- | --------- |
|
|
46
|
+
| ARAS | Additive Ratio ASsessment | [1] |
|
|
47
|
+
| CODAS | COmbinative Distance-based ASsessment | [2] |
|
|
48
|
+
| COPRAS | COmplex PRoportional ASsessment | [3] |
|
|
49
|
+
| EDAS | Evaluation based on Distance from Average Solution | [4] |
|
|
50
|
+
| MABAC | Multi-Attributive Border Approximation area Comparison | [5] |
|
|
51
|
+
| MAIRCA | MultiAttributive Ideal-Real Comparative Analysis | [6] |
|
|
52
|
+
| MOORA | Multi-Objective Optimization Method by Ratio Analysis | [7] |
|
|
53
|
+
| OCRA | Operational Competitiveness Ratings | [8] |
|
|
54
|
+
| TOPSIS | Technique for the Order of Prioritisation by Similarity to Ideal Solution | [9] |
|
|
55
|
+
| VIKOR | VIseKriterijumska Optimizacija I Kompromisno Resenje | [10] |
|
|
56
|
+
|
|
57
|
+
- Weighting methods:
|
|
58
|
+
|
|
59
|
+
| Name | Reference |
|
|
60
|
+
| -------------------------- | :-------: |
|
|
61
|
+
| Equal weights | [11] |
|
|
62
|
+
| Shannon entropy weights | [12] |
|
|
63
|
+
| Standard deviation weights | [13] |
|
|
64
|
+
| Variance weights | [14] |
|
|
65
|
+
|
|
66
|
+
- Normalization methods:
|
|
67
|
+
|
|
68
|
+
| Name | Reference |
|
|
69
|
+
| --------------------- | :-------: |
|
|
70
|
+
| Sum Normalization | [1] |
|
|
71
|
+
| Max Normalization | [2] |
|
|
72
|
+
| Linear Normalization | [15] |
|
|
73
|
+
| Min-Max Normalization | [5] |
|
|
74
|
+
| Vector Normalization | [7] |
|
|
75
|
+
| SAW Normalization | [3,24] |
|
|
76
|
+
|
|
77
|
+
- Defuzzification methods:
|
|
78
|
+
|
|
79
|
+
| Name | Reference |
|
|
80
|
+
| ----------------------------------- | :-------: |
|
|
81
|
+
| Mean defuzzification | [16,17] |
|
|
82
|
+
| Mean area defuzzification | [15] |
|
|
83
|
+
| Graded mean average defuzzification | [4] |
|
|
84
|
+
| Weighted mean defuzzification | [10] |
|
|
85
|
+
|
|
86
|
+
- Distance measures:
|
|
87
|
+
|
|
88
|
+
| Name | Reference |
|
|
89
|
+
| --------------------------- | :-------: |
|
|
90
|
+
| Euclidean distance | [18] |
|
|
91
|
+
| Weighted Euclidean distance | [15] |
|
|
92
|
+
| Hamming distance | [19] |
|
|
93
|
+
| Weighted Hamming distance | [15] |
|
|
94
|
+
| Vertex distance | [15] |
|
|
95
|
+
| Tran Duckstein distance | [19] |
|
|
96
|
+
| L-R distance | [19] |
|
|
97
|
+
| Mahdavi distance | [18] |
|
|
98
|
+
|
|
99
|
+
- Correlation coefficients:
|
|
100
|
+
|
|
101
|
+
| Name | Reference |
|
|
102
|
+
| ----------------------------------------- | :-------: |
|
|
103
|
+
| Spearman correlation coefficient | [20] |
|
|
104
|
+
| Pearson correlation coefficient | [21] |
|
|
105
|
+
| Weighted Spearman correlation coefficient | [22] |
|
|
106
|
+
| WS Rank Similarity coefficient | [23] |
|
|
107
|
+
|
|
108
|
+
- Helpers methods
|
|
109
|
+
- rank
|
|
110
|
+
- generarte_fuzzy_matrix
|
|
111
|
+
|
|
112
|
+
# Usage example
|
|
113
|
+
|
|
114
|
+
Below the sample example of the package functionalities is presented.
|
|
115
|
+
More usage examples of available methods are presented in [Jupyter examples](https://github.com/jwieckowski/pyfdm).
|
|
116
|
+
|
|
117
|
+
```python
|
|
118
|
+
from pyfdm.methods import fARAS
|
|
119
|
+
from pyfdm.helpers import rank
|
|
120
|
+
import numpy as np
|
|
121
|
+
|
|
122
|
+
if __name__ == '__main__':
|
|
123
|
+
matrix = np.array([
|
|
124
|
+
[[5, 7, 9], [5, 7, 9], [7, 9, 9]],
|
|
125
|
+
[[1, 3, 5], [3, 5, 7], [3, 5, 7]],
|
|
126
|
+
[[1, 1, 3], [1, 3, 5], [1, 3, 5]],
|
|
127
|
+
[[7, 9, 9], [7, 9, 9], [7, 9, 9]]
|
|
128
|
+
])
|
|
129
|
+
|
|
130
|
+
weights = np.array([[5, 7, 9], [7, 9, 9], [3, 5, 7]])
|
|
131
|
+
types = np.array([1, -1, 1])
|
|
132
|
+
|
|
133
|
+
f_aras = fARAS()
|
|
134
|
+
pref = f_aras(matrix, weights, types)
|
|
135
|
+
|
|
136
|
+
print(f'Fuzzy ARAS preferences: {pref}')
|
|
137
|
+
print(f'Fuzzy ARAS ranking: {rank(pref)}')
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
Output:
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
Fuzzy ARAS preferences: 1.011 0.854 1.312 0.993
|
|
144
|
+
Fuzzy ARAS ranking: 2 4 1 3
|
|
145
|
+
```
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
### References
|
|
149
|
+
|
|
150
|
+
[1] Fu, Y. K., Wu, C. J., & Liao, C. N. (2021). Selection of in-flight duty-free product suppliers using a combination fuzzy AHP, fuzzy ARAS, and MSGP methods. Mathematical Problems in Engineering, 2021.
|
|
151
|
+
|
|
152
|
+
[2] Panchal, D., Chatterjee, P., Shukla, R. K., Choudhury, T., & Tamosaitiene, J. (2017). Integrated Fuzzy AHP-Codas Framework for Maintenance Decision in Urea Fertilizer Industry. Economic Computation & Economic Cybernetics Studies & Research, 51(3).
|
|
153
|
+
|
|
154
|
+
[3] Narang, M., Joshi, M. C., & Pal, A. K. (2021). A hybrid fuzzy COPRAS-base-criterion method for multi-criteria decision making. Soft Computing, 25(13), 8391-8399.
|
|
155
|
+
|
|
156
|
+
[4] Zindani, D., Maity, S. R., & Bhowmik, S. (2019). Fuzzy-EDAS (evaluation based on distance from average solution) for material selection problems. In Advances in Computational Methods in Manufacturing (pp. 755-771). Springer, Singapore.
|
|
157
|
+
|
|
158
|
+
[5] Bozanic, D., Tešić, D., & Milićević, J. (2018). A hybrid fuzzy AHP-MABAC model: Application in the Serbian Army–The selection of the location for deep wading as a technique of crossing the river by tanks. Decision Making: Applications in Management and Engineering, 1(1), 143-164.
|
|
159
|
+
|
|
160
|
+
[6] Boral, S., Howard, I., Chaturvedi, S. K., McKee, K., & Naikan, V. N. A. (2020). An integrated approach for fuzzy failure modes and effects analysis using fuzzy AHP and fuzzy MAIRCA. Engineering Failure Analysis, 108, 104195.
|
|
161
|
+
|
|
162
|
+
[7] Karande, P., & Chakraborty, S. (2012). A Fuzzy-MOORA approach for ERP system selection. Decision Science Letters, 1(1), 11-21.
|
|
163
|
+
|
|
164
|
+
[8] ULUTAŞ, A. (2019). Supplier selection by using a fuzzy integrated model for a textile company. Engineering Economics, 30(5), 579-590.
|
|
165
|
+
|
|
166
|
+
[9] Chen, C. T. (2000). Extensions of the TOPSIS for group decision-making under fuzzy environment. Fuzzy sets and systems, 114(1), 1-9.
|
|
167
|
+
|
|
168
|
+
[10] Opricovic, S. (2007). A fuzzy compromise solution for multicriteria problems. International Journal of Uncertainty, Fuzziness and Knowledge-Based Systems, 15(03), 363-380.
|
|
169
|
+
|
|
170
|
+
[11] Iskander, M. G. (2002). Comparison of fuzzy numbers using possibility programming: comments and new concepts. Computers & Mathematics with Applications, 43(6-7), 833-840.
|
|
171
|
+
|
|
172
|
+
[12] Kacprzak, D. (2017). Objective weights based on ordered fuzzy numbers for fuzzy multiple criteria decision-making methods. Entropy, 19(7), 373.
|
|
173
|
+
|
|
174
|
+
[13] Wang, Y. M., & Luo, Y. (2010). Integration of correlations with standard deviations for determining attribute weights in multiple attribute decision making. Mathematical and Computer Modelling, 51(1-2), 1-12.
|
|
175
|
+
|
|
176
|
+
[14] Bikmukhamedov, R., Yeryomin, Y., & Seitz, J. (2016, July). Evaluation of MCDA-based handover algorithms for mobile networks. In 2016 Eighth International Conference on Ubiquitous and Future Networks (ICUFN) (pp. 810-815). IEEE.
|
|
177
|
+
|
|
178
|
+
[15] Roszkowska, E., & Wachowicz, T. (2015). Application of fuzzy TOPSIS to scoring the negotiation offers in ill-structured negotiation problems. European Journal of Operational Research, 242(3), 920-932.
|
|
179
|
+
|
|
180
|
+
[16] Yılmaz, M., & Atan, T. (2021). Hospital site selection using fuzzy EDAS method: case study application for districts of Istanbul. Journal of Intelligent & Fuzzy Systems, (Preprint), 1-12.
|
|
181
|
+
|
|
182
|
+
[17] Zolfani, S. H., Görçün, Ö. F., & Küçükönder, H. (2021). Evaluating logistics villages in Turkey using hybrid improved fuzzy SWARA (IMF SWARA) and fuzzy MABAC techniques. Technological and Economic Development of Economy, 27(6), 1582-1612.
|
|
183
|
+
|
|
184
|
+
[18] Wang, H., Lu, X., Du, Y., Zhang, C., Sadiq, R., & Deng, Y. (2017). Fault tree analysis based on TOPSIS and triangular fuzzy number. International journal of system assurance engineering and management, 8(4), 2064-2070.
|
|
185
|
+
|
|
186
|
+
[19] Talukdar, P., & Dutta, P. A Comparative Study of TOPSIS Method via Different Distance Measure.
|
|
187
|
+
|
|
188
|
+
[20] Spearman, C. (1910). Correlation calculated from faulty data. British Journal of Psychology, 1904‐1920, 3(3), 271-295.
|
|
189
|
+
|
|
190
|
+
[21] Pearson, K. (1895). VII. Note on regression and inheritance in the case of two parents. proceedings of the royal society of London, 58(347-352), 240-242.
|
|
191
|
+
|
|
192
|
+
[22] Dancelli, L., Manisera, M., & Vezzoli, M. (2013). On two classes of Weighted Rank Correlation measures deriving from the Spearman’s ρ. In Statistical Models for Data Analysis (pp. 107-114). Springer, Heidelberg.
|
|
193
|
+
|
|
194
|
+
[23] Sałabun, W., & Urbaniak, K. (2020, June). A new coefficient of rankings similarity in decision-making problems. In International Conference on Computational Science (pp. 632-645). Springer, Cham.
|
|
195
|
+
|
|
196
|
+
[24] Saifullah, S. (2021). Fuzzy-AHP approach using Normalized Decision Matrix on Tourism Trend Ranking based-on Social Media. arXiv preprint arXiv:2102.04222.
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
setup.py
|
|
4
|
+
pyfdm/__init__.py
|
|
5
|
+
pyfdm/correlations.py
|
|
6
|
+
pyfdm/helpers.py
|
|
7
|
+
pyfdm/weights.py
|
|
8
|
+
pyfdm.egg-info/PKG-INFO
|
|
9
|
+
pyfdm.egg-info/SOURCES.txt
|
|
10
|
+
pyfdm.egg-info/dependency_links.txt
|
|
11
|
+
pyfdm.egg-info/requires.txt
|
|
12
|
+
pyfdm.egg-info/top_level.txt
|
|
13
|
+
pyfdm/methods/__init__.py
|
|
14
|
+
pyfdm/methods/f_aras.py
|
|
15
|
+
pyfdm/methods/f_codas.py
|
|
16
|
+
pyfdm/methods/f_copras.py
|
|
17
|
+
pyfdm/methods/f_edas.py
|
|
18
|
+
pyfdm/methods/f_mabac.py
|
|
19
|
+
pyfdm/methods/f_mairca.py
|
|
20
|
+
pyfdm/methods/f_moora.py
|
|
21
|
+
pyfdm/methods/f_ocra.py
|
|
22
|
+
pyfdm/methods/f_topsis.py
|
|
23
|
+
pyfdm/methods/f_vikor.py
|
|
24
|
+
pyfdm/methods/validator.py
|
|
25
|
+
pyfdm/methods/aras/__init__.py
|
|
26
|
+
pyfdm/methods/aras/fuzzy.py
|
|
27
|
+
pyfdm/methods/codas/__init__.py
|
|
28
|
+
pyfdm/methods/codas/fuzzy.py
|
|
29
|
+
pyfdm/methods/copras/__init__.py
|
|
30
|
+
pyfdm/methods/copras/fuzzy.py
|
|
31
|
+
pyfdm/methods/edas/__init__.py
|
|
32
|
+
pyfdm/methods/edas/fuzzy.py
|
|
33
|
+
pyfdm/methods/fuzzy_sets/__init__.py
|
|
34
|
+
pyfdm/methods/fuzzy_sets/tfn/__init__.py
|
|
35
|
+
pyfdm/methods/fuzzy_sets/tfn/defuzzifications.py
|
|
36
|
+
pyfdm/methods/fuzzy_sets/tfn/distances.py
|
|
37
|
+
pyfdm/methods/fuzzy_sets/tfn/normalizations.py
|
|
38
|
+
pyfdm/methods/mabac/__init__.py
|
|
39
|
+
pyfdm/methods/mabac/fuzzy.py
|
|
40
|
+
pyfdm/methods/mairca/__init__.py
|
|
41
|
+
pyfdm/methods/mairca/fuzzy.py
|
|
42
|
+
pyfdm/methods/moora/__init__.py
|
|
43
|
+
pyfdm/methods/moora/fuzzy.py
|
|
44
|
+
pyfdm/methods/ocra/__init__.py
|
|
45
|
+
pyfdm/methods/ocra/fuzzy.py
|
|
46
|
+
pyfdm/methods/topsis/__init__.py
|
|
47
|
+
pyfdm/methods/topsis/fuzzy.py
|
|
48
|
+
pyfdm/methods/vikor/__init__.py
|
|
49
|
+
pyfdm/methods/vikor/fuzzy.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pyfdm
|