TOPSIS implementation as a Python package
Project description
TOPSIS – Python Package
Project Description
Topsis-Paridhi-102303715 is a Python package for solving Multiple Criteria Decision Making (MCDM) problems using the
Technique for Order Preference by Similarity to Ideal Solution (TOPSIS).
This package allows users to rank alternatives based on multiple criteria by providing:
- a CSV input file
- a weight vector
- an impact vector
The package computes the TOPSIS score and rank for each alternative.
Installation
Use the package manager pip to install the package:
pip install Topsis-Paridhi-102303715
Input Parameters
-
Weights Vector A comma-separated list of numeric values representing the importance of each criterion. Example: 0.25,0.25,0.25,0.25
-
Impacts Vector A comma-separated list of impacts where:
- indicates a beneficial criterion
- indicates a non-beneficial criterion
Example: +,+,-,+
Usage:
topsis <input_file.csv> "<weights>" "<impacts>" <output_file.csv>
Example topsis sample.csv "0.25,0.25,0.25,0.25" "+,+,-,+" output.csv
Output
The output file is a CSV file containing:
- original input columns
- Topsis Score
- Rank
Sample Output
TOPSIS RESULTS
| Item | Similarity Score | Rank |
|---|---|---|
| A | 1.000000 | 1 |
| C | 0.976532 | 2 |
| B | 0.845210 | 3 |
Higher TOPSIS score indicates a better alternative.
Input File Format:
Input file must be a CSV file:
- First column should contain alternative names
- Remaining columns must contain numeric values only
- File must contain at least 3 columns
Example sample.csv
| Item | Feature1 | Feature2 | Feature3 |
|---|---|---|---|
| A | 10 | 7 | 9 |
| B | 8 | 6 | 5 |
| C | 9 | 9 | 8 |
Validation Rules:
The program performs the following validations:
- Input file existence check
- Minimum column count check
- Numeric value validation
- Equal number of weights, impacts, and criteria
- Impacts must be either + or -
- Weights and impacts must be comma-separated
- Appropriate error messages are displayed if invalid input is detected.
License
This project is licensed under the MIT License.
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_paridhi_102303715-1.0.1.tar.gz.
File metadata
- Download URL: topsis_paridhi_102303715-1.0.1.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0090503b86369ad9a143ae25ea7c9e7573314c0efca7a0f20d80f7022170bb37
|
|
| MD5 |
e939410b753d8387a77c9de76440ff23
|
|
| BLAKE2b-256 |
8b75734be930102bdeaf8aa131f772cb7c4be245ebcc9b4f7aa548c6b9077c82
|
File details
Details for the file topsis_paridhi_102303715-1.0.1-py3-none-any.whl.
File metadata
- Download URL: topsis_paridhi_102303715-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4bd13c8e8770da843de967a686f295225fc8a169219440267f480558abd8d4ef
|
|
| MD5 |
aa71c27ce7ba3a39d6e69ab094ae45eb
|
|
| BLAKE2b-256 |
9a3c9bb2078c028411910a54d5f930a4bb946320a934a66ecd8b15283901a836
|