A Python package for TOPSIS multi-criteria decision making
Project description
Topsis-Prabhsimar-102483078
PyPI version | License: MIT
📌 Description
This package implements the TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) method, a popular multi-criteria decision-making (MCDM) technique.
TOPSIS is used to rank alternatives based on their relative distance from:
- an ideal best solution
- an ideal worst solution
It helps decision-makers choose the best option among multiple alternatives.
🧠 Applications of TOPSIS
TOPSIS is widely used in:
- Product selection and comparison
- Supplier evaluation
- Project prioritization
- Performance assessment
- Resource allocation
- Investment analysis
⚙️ Installation
Install the package using pip:
pip install Topsis-Prabhsimar-102483078
🚀 Usage
After installation, the topsis command becomes available in the terminal.
Basic Syntax
topsis <input_csv> <weights> <impacts> <output_csv>
Parameters
| Parameter | Description |
|---|---|
| input_csv | Path to the CSV file containing the decision matrix |
| weights | Comma-separated numerical weights for each criterion |
| impacts | Comma-separated impacts (+ for benefit, - for cost) |
| output_csv | Path where the output CSV file will be saved |
📊 Example
Input File (sample.csv)
Model,Storage(in GB),Camera(in MP),Price(in $),Rating
M1,16,12,250,5
M2,16,8,200,3
M3,32,16,300,4
M4,32,8,275,4
M5,16,16,225,2
Decision Criteria
Weights Vector
0.25,0.25,0.25,0.25
Impacts Vector
+,+,-,+
- Storage → Benefit (+)
- Camera → Benefit (+)
- Price → Cost (-)
- Rating → Benefit (+)
Command
topsis sample.csv "0.25,0.25,0.25,0.25" "+,+,-,+" output.csv
📈 Output
The output CSV file will contain two additional columns:
- Topsis Score (closeness coefficient)
- Rank
Sample Output
| Model | Storage | Camera | Price | Rating | Topsis Score | Rank |
|---|---|---|---|---|---|---|
| M3 | 32 | 16 | 300 | 4 | 0.69 | 1 |
| M4 | 32 | 8 | 275 | 4 | 0.53 | 2 |
| M1 | 16 | 12 | 250 | 5 | 0.53 | 3 |
| M5 | 16 | 16 | 225 | 2 | 0.40 | 4 |
| M2 | 16 | 8 | 200 | 3 | 0.30 | 5 |
📋 Input File Requirements
- CSV format only
- First column must contain alternative names
- Remaining columns must be numeric
- No missing values
- Minimum 2 criteria columns required
⚠️ Important Notes
- Number of weights must equal number of criteria columns
- Number of impacts must equal number of criteria columns
- Weights must be positive numbers
- Impacts must be either + or -
- All criterion values must be numeric
🔧 How TOPSIS Works
- Normalize the decision matrix
- Apply weights to normalized values
- Determine ideal best and ideal worst solutions
- Compute distances from ideal best and worst
- Calculate closeness coefficient
- Rank alternatives based on score
📝 License
This project is licensed under the MIT License.
👤 Author
Prabhsimar Singh
Roll Number: 102483078
📚 Academic Note
This package was developed as part of an academic assignment for
UCS654 – Prescriptive Analytics
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file topsis_prabhsimar_102483078-1.0.2.tar.gz.
File metadata
- Download URL: topsis_prabhsimar_102483078-1.0.2.tar.gz
- Upload date:
- Size: 4.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
70c927a3e20448fcc200a597870611075db039ad247dbe99df90f93eb06b9912
|
|
| MD5 |
0257453e39d1a34382aebdc186e7bfc0
|
|
| BLAKE2b-256 |
d14dbcf5f80e5240c412286296e9d61fa53e778f8f0fc1f8b6d9c950ddac7c34
|
File details
Details for the file topsis_prabhsimar_102483078-1.0.2-py3-none-any.whl.
File metadata
- Download URL: topsis_prabhsimar_102483078-1.0.2-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bc68bf5c585a345986f61395988e3980f58fa2d4d52bd3833d298e120f7e5ef1
|
|
| MD5 |
c0d840c7da33be8a394c09027c4a546c
|
|
| BLAKE2b-256 |
5369f9d44980fe3c62e53de0ced5f2ef2f881bd26d3738f8277e1ea80fc7d35a
|