A Python package for TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution)
Project description
102203525_TOPSIS
102203525_TOPSIS is a Python package that implements the TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) method, which is a multi-criteria decision analysis method. This package allows users to calculate TOPSIS scores and ranks for given datasets.
Installation
You can install the package using pip:
pip install 102203525_TOPSIS
Command-Line Usage
After installation, you can use the run-topsis command to perform the analysis.
Command Syntax
run-topsis <input_data_file> <weights> <impacts> <result_file_name>
<input_data_file>: Path to the input data file (CSV or Excel).<weights>: Comma-separated list of weights for each criterion.<impacts>: Comma-separated list of impacts for each criterion (+for beneficial,-for non-beneficial).<result_file_name>: Path to save the result file (CSV or Excel).
Sample Command
run-topsis data/input.xlsx "0.4,0.3,0.2,0.1" "+,+,-,+" result/output.xlsx
How It Works
- Data Loading: The script reads the input data from the specified file.
- Normalization: Each column is normalized to make the data comparable.
- Weighting: The normalized data is weighted according to the provided weights.
- Ideal Solutions: Ideal best and worst solutions are determined based on the impacts (
+or-). - Separation Measures: The distance of each alternative from the ideal best and worst solutions is calculated.
- TOPSIS Score: The relative closeness to the ideal solution is computed.
- Ranking: Alternatives are ranked based on their TOPSIS scores.
Example
Input Data (input.xlsx):
| Alternative | Criterion 1 | Criterion 2 | Criterion 3 | Criterion 4 |
|---|---|---|---|---|
| A | 250 | 16 | 12 | 5 |
| B | 200 | 20 | 8 | 3 |
| C | 300 | 11 | 15 | 7 |
| D | 275 | 15 | 10 | 4 |
Running the Command:
run-topsis input.xlsx "0.4,0.3,0.2,0.1" "+,+,-,+" output.xlsx
Result Data (output.xlsx):
| Alternative | Criterion 1 | Criterion 2 | Criterion 3 | Criterion 4 | topsis_scores | rank |
|---|---|---|---|---|---|---|
| A | 250 | 16 | 12 | 5 | 0.691 | 2 |
| B | 200 | 20 | 8 | 3 | 0.437 | 4 |
| C | 300 | 11 | 15 | 7 | 0.824 | 1 |
| D | 275 | 15 | 10 | 4 | 0.620 | 3 |
By following the above steps, you can easily perform TOPSIS analysis using the 102203525_TOPSIS package. For any issues or suggestions, feel free to open an issue on the GitHub repository.
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 102203525_TOPSIS-0.1.2.tar.gz.
File metadata
- Download URL: 102203525_TOPSIS-0.1.2.tar.gz
- Upload date:
- Size: 3.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ee79291fa22d94b9fda3f67953d8b6b3b654d68329389a46c077cb1aebfb7a4e
|
|
| MD5 |
5fdf8bda267dc5f6ccacc5e8f0885672
|
|
| BLAKE2b-256 |
f0ea94c10bd607fdc22e44ac2a1d41d092b03027832cf4d583eb40c5c4bb71b3
|
File details
Details for the file 102203525_TOPSIS-0.1.2-py3-none-any.whl.
File metadata
- Download URL: 102203525_TOPSIS-0.1.2-py3-none-any.whl
- Upload date:
- Size: 3.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
603db94d3c3eda7a3e09518139fa2f20abf44e0b5439c8d3e64c1902477db30d
|
|
| MD5 |
d9fa13da83c781ac89a31f89fd1629d5
|
|
| BLAKE2b-256 |
351b925ba52395f0b5e3ae0dcd85dbb64f8cf07a917106eb8d0fc8727224e3b4
|