topsis-anshul-102303930 1.0.1__tar.gz → 1.0.2__tar.gz
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.
- topsis_anshul_102303930-1.0.2/PKG-INFO +163 -0
- topsis_anshul_102303930-1.0.2/README.md +148 -0
- {topsis_anshul_102303930-1.0.1 → topsis_anshul_102303930-1.0.2}/setup.py +1 -1
- topsis_anshul_102303930-1.0.2/topsis_anshul_102303930.egg-info/PKG-INFO +163 -0
- topsis_anshul_102303930-1.0.1/PKG-INFO +0 -97
- topsis_anshul_102303930-1.0.1/README.md +0 -82
- topsis_anshul_102303930-1.0.1/topsis_anshul_102303930.egg-info/PKG-INFO +0 -97
- {topsis_anshul_102303930-1.0.1 → topsis_anshul_102303930-1.0.2}/LICENSE +0 -0
- {topsis_anshul_102303930-1.0.1 → topsis_anshul_102303930-1.0.2}/setup.cfg +0 -0
- {topsis_anshul_102303930-1.0.1 → topsis_anshul_102303930-1.0.2}/topsis_anshul/__init__.py +0 -0
- {topsis_anshul_102303930-1.0.1 → topsis_anshul_102303930-1.0.2}/topsis_anshul/topsis.py +0 -0
- {topsis_anshul_102303930-1.0.1 → topsis_anshul_102303930-1.0.2}/topsis_anshul_102303930.egg-info/SOURCES.txt +0 -0
- {topsis_anshul_102303930-1.0.1 → topsis_anshul_102303930-1.0.2}/topsis_anshul_102303930.egg-info/dependency_links.txt +0 -0
- {topsis_anshul_102303930-1.0.1 → topsis_anshul_102303930-1.0.2}/topsis_anshul_102303930.egg-info/entry_points.txt +0 -0
- {topsis_anshul_102303930-1.0.1 → topsis_anshul_102303930-1.0.2}/topsis_anshul_102303930.egg-info/requires.txt +0 -0
- {topsis_anshul_102303930-1.0.1 → topsis_anshul_102303930-1.0.2}/topsis_anshul_102303930.egg-info/top_level.txt +0 -0
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: topsis-anshul-102303930
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: A Python package for TOPSIS multi-criteria decision making
|
|
5
|
+
Author: Anshul Kaushal
|
|
6
|
+
Author-email: anshulkaushal27@gmail.com
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.6
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: pandas
|
|
14
|
+
Requires-Dist: numpy
|
|
15
|
+
|
|
16
|
+
# Topsis-Anshul-102303930
|
|
17
|
+
|
|
18
|
+
[](https://badge.fury.io/py/Topsis-Anshul-102303930)
|
|
19
|
+
[](https://opensource.org/licenses/MIT)
|
|
20
|
+
|
|
21
|
+
## 📌 Description
|
|
22
|
+
|
|
23
|
+
This package implements the **TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)** method, a multi-criteria decision-making (MCDM) approach used to rank alternatives based on their distance from an ideal best and an ideal worst solution.
|
|
24
|
+
|
|
25
|
+
TOPSIS is widely used in various domains including:
|
|
26
|
+
- Product selection and comparison
|
|
27
|
+
- Supplier evaluation
|
|
28
|
+
- Project prioritization
|
|
29
|
+
- Performance assessment
|
|
30
|
+
- Resource allocation
|
|
31
|
+
|
|
32
|
+
## ⚙️ Installation
|
|
33
|
+
|
|
34
|
+
Install the package using pip:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install Topsis-Anshul-102303930
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 🚀 Usage
|
|
41
|
+
|
|
42
|
+
After installation, the `topsis` command becomes available in your terminal.
|
|
43
|
+
|
|
44
|
+
### Basic Syntax
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
topsis <input_csv> <weights> <impacts> <output_csv>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Parameters
|
|
51
|
+
|
|
52
|
+
| Parameter | Description |
|
|
53
|
+
|-----------|-------------|
|
|
54
|
+
| `input_csv` | Path to the CSV file containing the decision matrix |
|
|
55
|
+
| `weights` | Comma-separated numerical weights for each criterion |
|
|
56
|
+
| `impacts` | Comma-separated impacts (`+` for benefit, `-` for cost) |
|
|
57
|
+
| `output_csv` | Path where the output CSV file will be saved |
|
|
58
|
+
|
|
59
|
+
### Example Commands
|
|
60
|
+
|
|
61
|
+
With quotes:
|
|
62
|
+
```bash
|
|
63
|
+
topsis sample.csv "1,1,1,1" "+,-,+,+" output.csv
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Without quotes:
|
|
67
|
+
```bash
|
|
68
|
+
topsis sample.csv 1,1,1,1 +,-,+,+ output.csv
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 📊 Example
|
|
72
|
+
|
|
73
|
+
### Input File (`sample.csv`)
|
|
74
|
+
|
|
75
|
+
A CSV file showing data for different mobile handsets with varying features:
|
|
76
|
+
|
|
77
|
+
```csv
|
|
78
|
+
Model,Storage space(in gb),Camera(in MP),Price(in $),Looks(out of 5)
|
|
79
|
+
M1,16,12,250,5
|
|
80
|
+
M2,16,8,200,3
|
|
81
|
+
M3,32,16,300,4
|
|
82
|
+
M4,32,8,275,4
|
|
83
|
+
M5,16,16,225,2
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Decision Criteria
|
|
87
|
+
|
|
88
|
+
**Weights Vector:** `[0.25, 0.25, 0.25, 0.25]`
|
|
89
|
+
|
|
90
|
+
**Impacts Vector:** `[+, +, -, +]`
|
|
91
|
+
- Storage space: + (more is better)
|
|
92
|
+
- Camera: + (more is better)
|
|
93
|
+
- Price: - (less is better)
|
|
94
|
+
- Looks: + (more is better)
|
|
95
|
+
|
|
96
|
+
### Command
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
topsis sample.csv "0.25,0.25,0.25,0.25" "+,+,-,+" output.csv
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Output
|
|
103
|
+
|
|
104
|
+
The output file will contain the original data with two additional columns:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
TOPSIS RESULTS
|
|
108
|
+
-----------------------------
|
|
109
|
+
Model Storage space(in gb) Camera(in MP) Price(in $) Looks(out of 5) P-Score Rank
|
|
110
|
+
M1 16 12 250 5 0.534277 3
|
|
111
|
+
M2 16 8 200 3 0.308368 5
|
|
112
|
+
M3 32 16 300 4 0.691632 1
|
|
113
|
+
M4 32 8 275 4 0.534737 2
|
|
114
|
+
M5 16 16 225 2 0.401046 4
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Interpretation:** M3 ranks highest (Rank 1) with the best TOPSIS score of 0.691632, making it the optimal choice among the alternatives.
|
|
118
|
+
|
|
119
|
+
## 📋 Input File Requirements
|
|
120
|
+
|
|
121
|
+
1. **CSV Format:** The input file must be in CSV format
|
|
122
|
+
2. **First Column:** Should contain the names/identifiers of alternatives
|
|
123
|
+
3. **Remaining Columns:** Should contain numerical values for each criterion
|
|
124
|
+
4. **No Missing Values:** All cells must have valid numerical data (except the first column)
|
|
125
|
+
5. **Minimum Criteria:** At least 2 criteria columns are required
|
|
126
|
+
|
|
127
|
+
## ⚠️ Important Notes
|
|
128
|
+
|
|
129
|
+
- The number of weights must match the number of criteria columns
|
|
130
|
+
- The number of impacts must match the number of criteria columns
|
|
131
|
+
- Weights should be positive numbers
|
|
132
|
+
- Impacts should be either `+` (benefit) or `-` (cost)
|
|
133
|
+
- All criterion values must be numeric
|
|
134
|
+
|
|
135
|
+
## 🔧 How TOPSIS Works
|
|
136
|
+
|
|
137
|
+
1. **Normalize** the decision matrix
|
|
138
|
+
2. **Apply weights** to the normalized matrix
|
|
139
|
+
3. **Identify** ideal best and ideal worst solutions
|
|
140
|
+
4. **Calculate** the distance of each alternative from ideal best and ideal worst
|
|
141
|
+
5. **Compute** the performance score (closeness coefficient)
|
|
142
|
+
6. **Rank** alternatives based on performance scores
|
|
143
|
+
|
|
144
|
+
## 📝 License
|
|
145
|
+
|
|
146
|
+
This project is licensed under the MIT License.
|
|
147
|
+
|
|
148
|
+
## 👤 Author
|
|
149
|
+
|
|
150
|
+
**Anshul**
|
|
151
|
+
Roll Number: 102303930
|
|
152
|
+
|
|
153
|
+
## 🤝 Contributing
|
|
154
|
+
|
|
155
|
+
Contributions, issues, and feature requests are welcome!
|
|
156
|
+
|
|
157
|
+
## 📧 Contact
|
|
158
|
+
|
|
159
|
+
For any queries or suggestions, please feel free to reach out.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
**Note:** This package was created as part of an academic project for UCS654 - Prescriptive Analytics.
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
# Topsis-Anshul-102303930
|
|
2
|
+
|
|
3
|
+
[](https://badge.fury.io/py/Topsis-Anshul-102303930)
|
|
4
|
+
[](https://opensource.org/licenses/MIT)
|
|
5
|
+
|
|
6
|
+
## 📌 Description
|
|
7
|
+
|
|
8
|
+
This package implements the **TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)** method, a multi-criteria decision-making (MCDM) approach used to rank alternatives based on their distance from an ideal best and an ideal worst solution.
|
|
9
|
+
|
|
10
|
+
TOPSIS is widely used in various domains including:
|
|
11
|
+
- Product selection and comparison
|
|
12
|
+
- Supplier evaluation
|
|
13
|
+
- Project prioritization
|
|
14
|
+
- Performance assessment
|
|
15
|
+
- Resource allocation
|
|
16
|
+
|
|
17
|
+
## ⚙️ Installation
|
|
18
|
+
|
|
19
|
+
Install the package using pip:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
pip install Topsis-Anshul-102303930
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## 🚀 Usage
|
|
26
|
+
|
|
27
|
+
After installation, the `topsis` command becomes available in your terminal.
|
|
28
|
+
|
|
29
|
+
### Basic Syntax
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
topsis <input_csv> <weights> <impacts> <output_csv>
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
### Parameters
|
|
36
|
+
|
|
37
|
+
| Parameter | Description |
|
|
38
|
+
|-----------|-------------|
|
|
39
|
+
| `input_csv` | Path to the CSV file containing the decision matrix |
|
|
40
|
+
| `weights` | Comma-separated numerical weights for each criterion |
|
|
41
|
+
| `impacts` | Comma-separated impacts (`+` for benefit, `-` for cost) |
|
|
42
|
+
| `output_csv` | Path where the output CSV file will be saved |
|
|
43
|
+
|
|
44
|
+
### Example Commands
|
|
45
|
+
|
|
46
|
+
With quotes:
|
|
47
|
+
```bash
|
|
48
|
+
topsis sample.csv "1,1,1,1" "+,-,+,+" output.csv
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Without quotes:
|
|
52
|
+
```bash
|
|
53
|
+
topsis sample.csv 1,1,1,1 +,-,+,+ output.csv
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## 📊 Example
|
|
57
|
+
|
|
58
|
+
### Input File (`sample.csv`)
|
|
59
|
+
|
|
60
|
+
A CSV file showing data for different mobile handsets with varying features:
|
|
61
|
+
|
|
62
|
+
```csv
|
|
63
|
+
Model,Storage space(in gb),Camera(in MP),Price(in $),Looks(out of 5)
|
|
64
|
+
M1,16,12,250,5
|
|
65
|
+
M2,16,8,200,3
|
|
66
|
+
M3,32,16,300,4
|
|
67
|
+
M4,32,8,275,4
|
|
68
|
+
M5,16,16,225,2
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### Decision Criteria
|
|
72
|
+
|
|
73
|
+
**Weights Vector:** `[0.25, 0.25, 0.25, 0.25]`
|
|
74
|
+
|
|
75
|
+
**Impacts Vector:** `[+, +, -, +]`
|
|
76
|
+
- Storage space: + (more is better)
|
|
77
|
+
- Camera: + (more is better)
|
|
78
|
+
- Price: - (less is better)
|
|
79
|
+
- Looks: + (more is better)
|
|
80
|
+
|
|
81
|
+
### Command
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
topsis sample.csv "0.25,0.25,0.25,0.25" "+,+,-,+" output.csv
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
### Output
|
|
88
|
+
|
|
89
|
+
The output file will contain the original data with two additional columns:
|
|
90
|
+
|
|
91
|
+
```
|
|
92
|
+
TOPSIS RESULTS
|
|
93
|
+
-----------------------------
|
|
94
|
+
Model Storage space(in gb) Camera(in MP) Price(in $) Looks(out of 5) P-Score Rank
|
|
95
|
+
M1 16 12 250 5 0.534277 3
|
|
96
|
+
M2 16 8 200 3 0.308368 5
|
|
97
|
+
M3 32 16 300 4 0.691632 1
|
|
98
|
+
M4 32 8 275 4 0.534737 2
|
|
99
|
+
M5 16 16 225 2 0.401046 4
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Interpretation:** M3 ranks highest (Rank 1) with the best TOPSIS score of 0.691632, making it the optimal choice among the alternatives.
|
|
103
|
+
|
|
104
|
+
## 📋 Input File Requirements
|
|
105
|
+
|
|
106
|
+
1. **CSV Format:** The input file must be in CSV format
|
|
107
|
+
2. **First Column:** Should contain the names/identifiers of alternatives
|
|
108
|
+
3. **Remaining Columns:** Should contain numerical values for each criterion
|
|
109
|
+
4. **No Missing Values:** All cells must have valid numerical data (except the first column)
|
|
110
|
+
5. **Minimum Criteria:** At least 2 criteria columns are required
|
|
111
|
+
|
|
112
|
+
## ⚠️ Important Notes
|
|
113
|
+
|
|
114
|
+
- The number of weights must match the number of criteria columns
|
|
115
|
+
- The number of impacts must match the number of criteria columns
|
|
116
|
+
- Weights should be positive numbers
|
|
117
|
+
- Impacts should be either `+` (benefit) or `-` (cost)
|
|
118
|
+
- All criterion values must be numeric
|
|
119
|
+
|
|
120
|
+
## 🔧 How TOPSIS Works
|
|
121
|
+
|
|
122
|
+
1. **Normalize** the decision matrix
|
|
123
|
+
2. **Apply weights** to the normalized matrix
|
|
124
|
+
3. **Identify** ideal best and ideal worst solutions
|
|
125
|
+
4. **Calculate** the distance of each alternative from ideal best and ideal worst
|
|
126
|
+
5. **Compute** the performance score (closeness coefficient)
|
|
127
|
+
6. **Rank** alternatives based on performance scores
|
|
128
|
+
|
|
129
|
+
## 📝 License
|
|
130
|
+
|
|
131
|
+
This project is licensed under the MIT License.
|
|
132
|
+
|
|
133
|
+
## 👤 Author
|
|
134
|
+
|
|
135
|
+
**Anshul**
|
|
136
|
+
Roll Number: 102303930
|
|
137
|
+
|
|
138
|
+
## 🤝 Contributing
|
|
139
|
+
|
|
140
|
+
Contributions, issues, and feature requests are welcome!
|
|
141
|
+
|
|
142
|
+
## 📧 Contact
|
|
143
|
+
|
|
144
|
+
For any queries or suggestions, please feel free to reach out.
|
|
145
|
+
|
|
146
|
+
---
|
|
147
|
+
|
|
148
|
+
**Note:** This package was created as part of an academic project for UCS654 - Prescriptive Analytics.
|
|
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
|
|
|
2
2
|
|
|
3
3
|
setup(
|
|
4
4
|
name="topsis-anshul-102303930",
|
|
5
|
-
version="1.0.
|
|
5
|
+
version="1.0.2",
|
|
6
6
|
author="Anshul Kaushal",
|
|
7
7
|
author_email="anshulkaushal27@gmail.com",
|
|
8
8
|
description="A Python package for TOPSIS multi-criteria decision making",
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: topsis-anshul-102303930
|
|
3
|
+
Version: 1.0.2
|
|
4
|
+
Summary: A Python package for TOPSIS multi-criteria decision making
|
|
5
|
+
Author: Anshul Kaushal
|
|
6
|
+
Author-email: anshulkaushal27@gmail.com
|
|
7
|
+
Classifier: Programming Language :: Python :: 3
|
|
8
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
+
Classifier: Operating System :: OS Independent
|
|
10
|
+
Requires-Python: >=3.6
|
|
11
|
+
Description-Content-Type: text/markdown
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Dist: pandas
|
|
14
|
+
Requires-Dist: numpy
|
|
15
|
+
|
|
16
|
+
# Topsis-Anshul-102303930
|
|
17
|
+
|
|
18
|
+
[](https://badge.fury.io/py/Topsis-Anshul-102303930)
|
|
19
|
+
[](https://opensource.org/licenses/MIT)
|
|
20
|
+
|
|
21
|
+
## 📌 Description
|
|
22
|
+
|
|
23
|
+
This package implements the **TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)** method, a multi-criteria decision-making (MCDM) approach used to rank alternatives based on their distance from an ideal best and an ideal worst solution.
|
|
24
|
+
|
|
25
|
+
TOPSIS is widely used in various domains including:
|
|
26
|
+
- Product selection and comparison
|
|
27
|
+
- Supplier evaluation
|
|
28
|
+
- Project prioritization
|
|
29
|
+
- Performance assessment
|
|
30
|
+
- Resource allocation
|
|
31
|
+
|
|
32
|
+
## ⚙️ Installation
|
|
33
|
+
|
|
34
|
+
Install the package using pip:
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
pip install Topsis-Anshul-102303930
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## 🚀 Usage
|
|
41
|
+
|
|
42
|
+
After installation, the `topsis` command becomes available in your terminal.
|
|
43
|
+
|
|
44
|
+
### Basic Syntax
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
topsis <input_csv> <weights> <impacts> <output_csv>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### Parameters
|
|
51
|
+
|
|
52
|
+
| Parameter | Description |
|
|
53
|
+
|-----------|-------------|
|
|
54
|
+
| `input_csv` | Path to the CSV file containing the decision matrix |
|
|
55
|
+
| `weights` | Comma-separated numerical weights for each criterion |
|
|
56
|
+
| `impacts` | Comma-separated impacts (`+` for benefit, `-` for cost) |
|
|
57
|
+
| `output_csv` | Path where the output CSV file will be saved |
|
|
58
|
+
|
|
59
|
+
### Example Commands
|
|
60
|
+
|
|
61
|
+
With quotes:
|
|
62
|
+
```bash
|
|
63
|
+
topsis sample.csv "1,1,1,1" "+,-,+,+" output.csv
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
Without quotes:
|
|
67
|
+
```bash
|
|
68
|
+
topsis sample.csv 1,1,1,1 +,-,+,+ output.csv
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
## 📊 Example
|
|
72
|
+
|
|
73
|
+
### Input File (`sample.csv`)
|
|
74
|
+
|
|
75
|
+
A CSV file showing data for different mobile handsets with varying features:
|
|
76
|
+
|
|
77
|
+
```csv
|
|
78
|
+
Model,Storage space(in gb),Camera(in MP),Price(in $),Looks(out of 5)
|
|
79
|
+
M1,16,12,250,5
|
|
80
|
+
M2,16,8,200,3
|
|
81
|
+
M3,32,16,300,4
|
|
82
|
+
M4,32,8,275,4
|
|
83
|
+
M5,16,16,225,2
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
### Decision Criteria
|
|
87
|
+
|
|
88
|
+
**Weights Vector:** `[0.25, 0.25, 0.25, 0.25]`
|
|
89
|
+
|
|
90
|
+
**Impacts Vector:** `[+, +, -, +]`
|
|
91
|
+
- Storage space: + (more is better)
|
|
92
|
+
- Camera: + (more is better)
|
|
93
|
+
- Price: - (less is better)
|
|
94
|
+
- Looks: + (more is better)
|
|
95
|
+
|
|
96
|
+
### Command
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
topsis sample.csv "0.25,0.25,0.25,0.25" "+,+,-,+" output.csv
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### Output
|
|
103
|
+
|
|
104
|
+
The output file will contain the original data with two additional columns:
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
TOPSIS RESULTS
|
|
108
|
+
-----------------------------
|
|
109
|
+
Model Storage space(in gb) Camera(in MP) Price(in $) Looks(out of 5) P-Score Rank
|
|
110
|
+
M1 16 12 250 5 0.534277 3
|
|
111
|
+
M2 16 8 200 3 0.308368 5
|
|
112
|
+
M3 32 16 300 4 0.691632 1
|
|
113
|
+
M4 32 8 275 4 0.534737 2
|
|
114
|
+
M5 16 16 225 2 0.401046 4
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
**Interpretation:** M3 ranks highest (Rank 1) with the best TOPSIS score of 0.691632, making it the optimal choice among the alternatives.
|
|
118
|
+
|
|
119
|
+
## 📋 Input File Requirements
|
|
120
|
+
|
|
121
|
+
1. **CSV Format:** The input file must be in CSV format
|
|
122
|
+
2. **First Column:** Should contain the names/identifiers of alternatives
|
|
123
|
+
3. **Remaining Columns:** Should contain numerical values for each criterion
|
|
124
|
+
4. **No Missing Values:** All cells must have valid numerical data (except the first column)
|
|
125
|
+
5. **Minimum Criteria:** At least 2 criteria columns are required
|
|
126
|
+
|
|
127
|
+
## ⚠️ Important Notes
|
|
128
|
+
|
|
129
|
+
- The number of weights must match the number of criteria columns
|
|
130
|
+
- The number of impacts must match the number of criteria columns
|
|
131
|
+
- Weights should be positive numbers
|
|
132
|
+
- Impacts should be either `+` (benefit) or `-` (cost)
|
|
133
|
+
- All criterion values must be numeric
|
|
134
|
+
|
|
135
|
+
## 🔧 How TOPSIS Works
|
|
136
|
+
|
|
137
|
+
1. **Normalize** the decision matrix
|
|
138
|
+
2. **Apply weights** to the normalized matrix
|
|
139
|
+
3. **Identify** ideal best and ideal worst solutions
|
|
140
|
+
4. **Calculate** the distance of each alternative from ideal best and ideal worst
|
|
141
|
+
5. **Compute** the performance score (closeness coefficient)
|
|
142
|
+
6. **Rank** alternatives based on performance scores
|
|
143
|
+
|
|
144
|
+
## 📝 License
|
|
145
|
+
|
|
146
|
+
This project is licensed under the MIT License.
|
|
147
|
+
|
|
148
|
+
## 👤 Author
|
|
149
|
+
|
|
150
|
+
**Anshul**
|
|
151
|
+
Roll Number: 102303930
|
|
152
|
+
|
|
153
|
+
## 🤝 Contributing
|
|
154
|
+
|
|
155
|
+
Contributions, issues, and feature requests are welcome!
|
|
156
|
+
|
|
157
|
+
## 📧 Contact
|
|
158
|
+
|
|
159
|
+
For any queries or suggestions, please feel free to reach out.
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
**Note:** This package was created as part of an academic project for UCS654 - Prescriptive Analytics.
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: topsis-anshul-102303930
|
|
3
|
-
Version: 1.0.1
|
|
4
|
-
Summary: A Python package for TOPSIS multi-criteria decision making
|
|
5
|
-
Author: Anshul Kaushal
|
|
6
|
-
Author-email: anshulkaushal27@gmail.com
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
-
Classifier: Operating System :: OS Independent
|
|
10
|
-
Requires-Python: >=3.6
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
License-File: LICENSE
|
|
13
|
-
Requires-Dist: pandas
|
|
14
|
-
Requires-Dist: numpy
|
|
15
|
-
|
|
16
|
-
\# Topsis-Anshul-102303930
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
\## 📌 Description
|
|
21
|
-
|
|
22
|
-
This package implements the TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) method.
|
|
23
|
-
|
|
24
|
-
TOPSIS is a multi-criteria decision-making approach used to rank alternatives based on their distance from
|
|
25
|
-
|
|
26
|
-
an ideal best and an ideal worst solution.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
\## ⚙️ Installation
|
|
35
|
-
|
|
36
|
-
Install the package using pip:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
|
|
42
|
-
pip install Topsis-Anshul-102303930
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
\## Usage
|
|
47
|
-
|
|
48
|
-
\# After installation, the topsis command becomes available in the terminal.
|
|
49
|
-
topsis <input_csv> <weights> <impacts> <output_csv>
|
|
50
|
-
|
|
51
|
-
Parameters
|
|
52
|
-
Parameter Description
|
|
53
|
-
input_csv CSV file containing the dataset
|
|
54
|
-
weights Comma-separated numerical weights
|
|
55
|
-
impacts Comma-separated impacts (+ for benefit, - for cost)
|
|
56
|
-
|
|
57
|
-
Example Commands
|
|
58
|
-
|
|
59
|
-
topsis sample.csv "1,1,1,1" "+,-,+,+"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Weights and impacts can also be provided without quotes:
|
|
63
|
-
|
|
64
|
-
topsis sample.csv 1,1,1,1 +,-,+,+
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
Example
|
|
68
|
-
Input File (sample.csv)
|
|
69
|
-
|
|
70
|
-
A CSV file showing data for different mobile handsets with varying features:
|
|
71
|
-
|
|
72
|
-
Model,Storage space(in gb),Camera(in MP),Price(in $),Looks(out of 5)
|
|
73
|
-
M1,16,12,250,5
|
|
74
|
-
M2,16,8,200,3
|
|
75
|
-
M3,32,16,300,4
|
|
76
|
-
M4,32,8,275,4
|
|
77
|
-
M5,16,16,225,2
|
|
78
|
-
|
|
79
|
-
Weights Vector
|
|
80
|
-
[0.25, 0.25, 0.25, 0.25]
|
|
81
|
-
|
|
82
|
-
Impacts Vector
|
|
83
|
-
[+, +, -, +]
|
|
84
|
-
|
|
85
|
-
Command
|
|
86
|
-
topsis sample.csv "0.25,0.25,0.25,0.25" "+,+,-,+"
|
|
87
|
-
|
|
88
|
-
Output
|
|
89
|
-
TOPSIS RESULTS
|
|
90
|
-
-----------------------------
|
|
91
|
-
|
|
92
|
-
P-Score Rank
|
|
93
|
-
1 0.534277 3
|
|
94
|
-
2 0.308368 5
|
|
95
|
-
3 0.691632 1
|
|
96
|
-
4 0.534737 2
|
|
97
|
-
5 0.401046 4
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
\# Topsis-Anshul-102303930
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
\## 📌 Description
|
|
6
|
-
|
|
7
|
-
This package implements the TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) method.
|
|
8
|
-
|
|
9
|
-
TOPSIS is a multi-criteria decision-making approach used to rank alternatives based on their distance from
|
|
10
|
-
|
|
11
|
-
an ideal best and an ideal worst solution.
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
---
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
\## ⚙️ Installation
|
|
20
|
-
|
|
21
|
-
Install the package using pip:
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
```bash
|
|
26
|
-
|
|
27
|
-
pip install Topsis-Anshul-102303930
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
\## Usage
|
|
32
|
-
|
|
33
|
-
\# After installation, the topsis command becomes available in the terminal.
|
|
34
|
-
topsis <input_csv> <weights> <impacts> <output_csv>
|
|
35
|
-
|
|
36
|
-
Parameters
|
|
37
|
-
Parameter Description
|
|
38
|
-
input_csv CSV file containing the dataset
|
|
39
|
-
weights Comma-separated numerical weights
|
|
40
|
-
impacts Comma-separated impacts (+ for benefit, - for cost)
|
|
41
|
-
|
|
42
|
-
Example Commands
|
|
43
|
-
|
|
44
|
-
topsis sample.csv "1,1,1,1" "+,-,+,+"
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
Weights and impacts can also be provided without quotes:
|
|
48
|
-
|
|
49
|
-
topsis sample.csv 1,1,1,1 +,-,+,+
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
Example
|
|
53
|
-
Input File (sample.csv)
|
|
54
|
-
|
|
55
|
-
A CSV file showing data for different mobile handsets with varying features:
|
|
56
|
-
|
|
57
|
-
Model,Storage space(in gb),Camera(in MP),Price(in $),Looks(out of 5)
|
|
58
|
-
M1,16,12,250,5
|
|
59
|
-
M2,16,8,200,3
|
|
60
|
-
M3,32,16,300,4
|
|
61
|
-
M4,32,8,275,4
|
|
62
|
-
M5,16,16,225,2
|
|
63
|
-
|
|
64
|
-
Weights Vector
|
|
65
|
-
[0.25, 0.25, 0.25, 0.25]
|
|
66
|
-
|
|
67
|
-
Impacts Vector
|
|
68
|
-
[+, +, -, +]
|
|
69
|
-
|
|
70
|
-
Command
|
|
71
|
-
topsis sample.csv "0.25,0.25,0.25,0.25" "+,+,-,+"
|
|
72
|
-
|
|
73
|
-
Output
|
|
74
|
-
TOPSIS RESULTS
|
|
75
|
-
-----------------------------
|
|
76
|
-
|
|
77
|
-
P-Score Rank
|
|
78
|
-
1 0.534277 3
|
|
79
|
-
2 0.308368 5
|
|
80
|
-
3 0.691632 1
|
|
81
|
-
4 0.534737 2
|
|
82
|
-
5 0.401046 4
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
Metadata-Version: 2.1
|
|
2
|
-
Name: topsis-anshul-102303930
|
|
3
|
-
Version: 1.0.1
|
|
4
|
-
Summary: A Python package for TOPSIS multi-criteria decision making
|
|
5
|
-
Author: Anshul Kaushal
|
|
6
|
-
Author-email: anshulkaushal27@gmail.com
|
|
7
|
-
Classifier: Programming Language :: Python :: 3
|
|
8
|
-
Classifier: License :: OSI Approved :: MIT License
|
|
9
|
-
Classifier: Operating System :: OS Independent
|
|
10
|
-
Requires-Python: >=3.6
|
|
11
|
-
Description-Content-Type: text/markdown
|
|
12
|
-
License-File: LICENSE
|
|
13
|
-
Requires-Dist: pandas
|
|
14
|
-
Requires-Dist: numpy
|
|
15
|
-
|
|
16
|
-
\# Topsis-Anshul-102303930
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
\## 📌 Description
|
|
21
|
-
|
|
22
|
-
This package implements the TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) method.
|
|
23
|
-
|
|
24
|
-
TOPSIS is a multi-criteria decision-making approach used to rank alternatives based on their distance from
|
|
25
|
-
|
|
26
|
-
an ideal best and an ideal worst solution.
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
---
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
\## ⚙️ Installation
|
|
35
|
-
|
|
36
|
-
Install the package using pip:
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
```bash
|
|
41
|
-
|
|
42
|
-
pip install Topsis-Anshul-102303930
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
\## Usage
|
|
47
|
-
|
|
48
|
-
\# After installation, the topsis command becomes available in the terminal.
|
|
49
|
-
topsis <input_csv> <weights> <impacts> <output_csv>
|
|
50
|
-
|
|
51
|
-
Parameters
|
|
52
|
-
Parameter Description
|
|
53
|
-
input_csv CSV file containing the dataset
|
|
54
|
-
weights Comma-separated numerical weights
|
|
55
|
-
impacts Comma-separated impacts (+ for benefit, - for cost)
|
|
56
|
-
|
|
57
|
-
Example Commands
|
|
58
|
-
|
|
59
|
-
topsis sample.csv "1,1,1,1" "+,-,+,+"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
Weights and impacts can also be provided without quotes:
|
|
63
|
-
|
|
64
|
-
topsis sample.csv 1,1,1,1 +,-,+,+
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
Example
|
|
68
|
-
Input File (sample.csv)
|
|
69
|
-
|
|
70
|
-
A CSV file showing data for different mobile handsets with varying features:
|
|
71
|
-
|
|
72
|
-
Model,Storage space(in gb),Camera(in MP),Price(in $),Looks(out of 5)
|
|
73
|
-
M1,16,12,250,5
|
|
74
|
-
M2,16,8,200,3
|
|
75
|
-
M3,32,16,300,4
|
|
76
|
-
M4,32,8,275,4
|
|
77
|
-
M5,16,16,225,2
|
|
78
|
-
|
|
79
|
-
Weights Vector
|
|
80
|
-
[0.25, 0.25, 0.25, 0.25]
|
|
81
|
-
|
|
82
|
-
Impacts Vector
|
|
83
|
-
[+, +, -, +]
|
|
84
|
-
|
|
85
|
-
Command
|
|
86
|
-
topsis sample.csv "0.25,0.25,0.25,0.25" "+,+,-,+"
|
|
87
|
-
|
|
88
|
-
Output
|
|
89
|
-
TOPSIS RESULTS
|
|
90
|
-
-----------------------------
|
|
91
|
-
|
|
92
|
-
P-Score Rank
|
|
93
|
-
1 0.534277 3
|
|
94
|
-
2 0.308368 5
|
|
95
|
-
3 0.691632 1
|
|
96
|
-
4 0.534737 2
|
|
97
|
-
5 0.401046 4
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|