A Python package for TOPSIS (Technique for Order Preference by Similarity to Ideal Solution)
Project description
Topsis-Vani-102303078
A Python package implementing TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) for multi-criteria decision making.
Author: Vani Goyal
Roll Number: 102303078
Email: vgoyal_be23@thapar.edu
What is TOPSIS?
TOPSIS is a multi-criteria decision analysis method that identifies the best alternative by calculating the geometric distance from the ideal solution and the negative-ideal solution.
Installation
pip install Topsis-Vani-102303078
Usage
Command Line Interface
topsis <InputDataFile> <Weights> <Impacts> <OutputFileName>
Example
topsis data.csv "1,1,1,2" "+,+,-,+" result.csv
Python Module
from topsis_vani_102303078 import topsis
topsis('input.csv', '1,1,1,2', '+,+,-,+', 'output.csv')
Input Format
CSV file with:
- Column 1: Alternative names/IDs
- Columns 2-N: Numeric criteria values
Example:
Fund Name,P1,P2,P3,P4,P5
M1,0.84,0.71,6.7,42.1,12.59
M2,0.91,0.83,7.0,31.7,10.11
Parameters
Weights
Comma-separated positive numbers (e.g., "1,1,1,2")
Impacts
Comma-separated + or - signs:
+: Higher values are better (benefit criterion)-: Lower values are better (cost criterion)
Example: "+,+,-,+" means maximize P1, P2, P4 and minimize P3
Output
CSV file with original data plus:
- Topsis Score: Performance score (0-100, higher is better)
- Rank: Final ranking (1 is best)
Algorithm Steps
- Normalization: Vector normalization of decision matrix
- Weighted Matrix: Apply criterion weights
- Ideal Solutions: Identify best and worst solutions
- Distance Calculation: Euclidean distances from ideals
- TOPSIS Score: Closeness coefficient calculation
- Ranking: Sort by TOPSIS score
Requirements
- Python >= 3.7
- pandas >= 1.0.0
- numpy >= 1.18.0
License
MIT License - see LICENSE file
Links
- GitHub: https://github.com/vgalpha/Topsis-Vani-102303078
- PyPI: https://pypi.org/project/Topsis-Vani-102303078/
Author
Vani Goyal
Roll Number: 102303078
Thapar Institute of Engineering & Technology
Email: vgoyal_be23@thapar.edu
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_vani_102303078-1.0.0.tar.gz.
File metadata
- Download URL: topsis_vani_102303078-1.0.0.tar.gz
- Upload date:
- Size: 5.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7761057e85d36ac2da5ac70603a20d1a3c50b517f0fb3065fe96be29d447232
|
|
| MD5 |
48047ff3b8e9b69f7876de99c5d1ac2e
|
|
| BLAKE2b-256 |
f0e9eda67608e1b91109a59f27acc2f6f50f8f0b3b0f728ef7e7d1e326357e8c
|
File details
Details for the file topsis_vani_102303078-1.0.0-py3-none-any.whl.
File metadata
- Download URL: topsis_vani_102303078-1.0.0-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf32f5df2287a241f7c33c8b36256778114e930706f2c916f391e2b050a6f42e
|
|
| MD5 |
8f352eed7c74a50521f1cf5e7c64aaab
|
|
| BLAKE2b-256 |
f4d3879fb887381c63da468fe93fcdb22f114a1c269b36e81e8b0b9aa75af78e
|