A Python implementation of the TOPSIS method for multi-criteria decision making
Project description
TOPSIS Implementation in Python
Course: UCS654 – Predictive Analytics using Statistics
Assignment: Assignment-1 (TOPSIS)
Author: Sartaj Singh Virdi
Roll Number: 102303259
About the Project
This project implements the TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) method using Python.
TOPSIS is a Multi-Criteria Decision Making (MCDM) technique that ranks multiple alternatives based on their relative closeness to an ideal best solution and an ideal worst solution. It is widely used in decision-making problems involving multiple conflicting criteria.
Features
- Command-line based TOPSIS tool
- Supports CSV and Excel input files
- Automatically computes:
- Normalized decision matrix
- Weighted normalized matrix
- Ideal best & worst solutions
- TOPSIS score
- Final ranking of alternatives
- Easy to use and lightweight
Project Structure
topsis-mcdm-tool/
│── topsis/
│ ├── __init__.py
│ └── topsis.py
│── sample.csv
│── output.csv
│── setup.py
│── README.md
System Requirements
- Python: 3.7 or higher
- Libraries:
- pandas
- numpy
Installation
The package can be installed using pip after publishing to PyPI.
pip install topsis-mcdm-tool
(If installing locally for development)
pip install .
Usage
Run the following command in the terminal or command prompt:
topsis <inputFile> <weights> <impacts> <outputFile>
Parameters
inputFile→ CSV or Excel file containing dataweights→ Comma-separated weights for each criterionimpacts→+for benefit,-for cost criteriaoutputFile→ Output CSV/Excel file with scores and ranks
Example
topsis sample.csv "1,1,1,1" "+,+,-,+" result.csv
Output
The output file will contain:
- Topsis Score
- Rank (lower rank = better alternative)
Sample Input Format
Model,Price,Performance,Camera,Battery
A,25000,8,7,4000
B,30000,9,8,4500
C,20000,7,6,3800
Output Columns
Topsis Score– Closeness coefficientRank– Ranking of alternatives
Conclusion
This project demonstrates the practical implementation of the TOPSIS algorithm for multi-criteria decision making using Python. It is suitable for academic use and real-world decision analysis problems.
License
This project is released under the MIT License.
Project details
Release history Release notifications | RSS feed
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_decision_analysis-1.0.0.tar.gz.
File metadata
- Download URL: topsis_decision_analysis-1.0.0.tar.gz
- Upload date:
- Size: 4.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
543ca8e5a8b421f566280238c80d5313a77f9760b16ff74dbd230b1058a09586
|
|
| MD5 |
d138b569da5889c763b552e0f5c54caa
|
|
| BLAKE2b-256 |
4b6de2fb9b316e1ef1a8e0073d1be9d5bc385c1c5961a7902782157084cda41d
|
File details
Details for the file topsis_decision_analysis-1.0.0-py3-none-any.whl.
File metadata
- Download URL: topsis_decision_analysis-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6ffe69b88f1515446d69abadf7f56f64621372804e71cd58b3a268ccb99d746a
|
|
| MD5 |
4e9ad3ccce6a5d52f0708553a930047c
|
|
| BLAKE2b-256 |
0df683fc241af334e1d16047b3da9f4f480770524122fa45a83fa17295dc2abb
|