A Python package for implementing TOPSIS for multi-attribute analysis
Project description
TOPSIS-BHAVYA-102203806
A Python package for implementing the TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) method.
📖 Description
TOPSIS is a multi-criteria decision-making method that ranks alternatives based on their proximity to the ideal solution and distance from the worst solution. This package simplifies the computation, allowing users to rank options effectively by specifying criteria, weights, and impacts.
🛠 Installation
You can install the package via PyPI (if published): bash pip install topsis-BHAVYA-102203806
Or, clone this repository and install the required dependencies: bash git clone https://github.com/bmahajan230/topsis-BHAVYA-102203806.git cd topsis-BHAVYA-102203806 pip install -r requirements.txt
🚀 Usage
Run the package via the command line using the following syntax:
bash python <program.py> "" ""
Example Command:
bash python 102203806.py 102203806-data.csv "1,1,1,2" "+,+,-,+" 102203806-result.csv
Input Parameters:
- : Path to the input .csv file.
- : Comma-separated weights (e.g., "1,1,1,2").
- : Comma-separated impacts (e.g., " +,+,-,+").
- : Path to save the output .csv file.
📋 Input File Format
- File Type: .csv (Comma-Separated Values).
- Columns:
- The first column should contain the names of the alternatives (e.g., M1, M2, M3).
- Columns from the 2nd to last must contain numeric values only.
Example Input File (102203806-data.csv):
| Object | Criterion 1 | Criterion 2 | Criterion 3 | Criterion 4 |
|---|---|---|---|---|
| M1 | 50 | 30 | 20 | 40 |
| M2 | 60 | 20 | 40 | 30 |
📤 Output File Format
The output .csv file will include the input data with two additional columns:
- Topsis Score: A numerical value indicating the relative closeness to the ideal solution.
- Rank: The rank of each alternative based on the score.
Example Output File (102203806-result.csv):
| Object | Criterion 1 | Criterion 2 | Criterion 3 | Criterion 4 | Topsis Score | Rank |
|---|---|---|---|---|---|---|
| M1 | 50 | 30 | 20 | 40 | 0.67 | 2 |
| M2 | 60 | 20 | 40 | 30 | 0.89 | 1 |
🧰 Features
- Error Handling:
- Ensures the correct number of parameters are provided.
- Validates the input file format and contents.
- Checks for non-numeric values in the criteria columns.
- Simple CLI Interface:
- Intuitive and easy to run from the command line.
- Customizable:
- Accepts user-defined weights and impacts for the criteria.
✅ Requirements
- Python 3.6 or above
- Required libraries:
- pandas
- numpy
Install dependencies using: bash pip install -r requirements.txt
📚 References
👩💻 Author
- Name: Bhavya
- Roll Number: 102203806
- Email: bmahajan230@gmail.com
- GitHub: BHAVYA-3806
📝 License
This project is licensed 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_bhavya_102203806-0.1.tar.gz.
File metadata
- Download URL: topsis_bhavya_102203806-0.1.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2765caea55c5afed450f28869502a83d1e2976f4bc71f34e18563c1f94ed057c
|
|
| MD5 |
b3cf3c603f45036326c0b55991fbf5a7
|
|
| BLAKE2b-256 |
55a12b70a3889393642460b1eb99fc01cce6c795afaa896720be89af2eae3684
|
File details
Details for the file topsis_BHAVYA_102203806-0.1-py3-none-any.whl.
File metadata
- Download URL: topsis_BHAVYA_102203806-0.1-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3b226cfcf62574b42992667fb2122110994bb1dad4d549a8184826c3c4ae6ba5
|
|
| MD5 |
960b71503eacfa4fb629603cb0a19353
|
|
| BLAKE2b-256 |
237b9a427f43d517902c0464052bc1fe913351f324316b4418e25a607c95fc06
|