A Python package to implement the Topsis method for decision-making
Project description
Topsis-Minal102203788
TOPSIS Package
Overview
The TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) package is designed to help you rank and evaluate multiple alternatives based on a set of criteria. It simplifies the decision-making process by identifying the option closest to the ideal solution and farthest from the negative ideal solution.
Features
- Easy-to-use implementation of the TOPSIS algorithm.
- Supports data preprocessing and normalization.
- Handles multiple criteria with different weights.
- Outputs rankings and performance scores for each alternative.
Installation
Install the package using pip:
pip install topsispackage
Usage
Input Format
The input to the TOPSIS package should be a CSV file with the following structure:
| Alternative | Criterion 1 | Criterion 2 | ... | Criterion N |
|---|---|---|---|---|
| A1 | 10 | 20 | ... | 30 |
| A2 | 15 | 25 | ... | 35 |
- The first column should contain the names or labels of the alternatives.
- The subsequent columns should contain numerical values representing the criteria for each alternative.
Code Example
from topsispackage import topsis
# Provide the file path, weights, and impacts
data_file = "data.csv"
weights = [0.3, 0.4, 0.3] # Sum of weights should be 1
impacts = ['+', '+', '-'] # '+' for benefit, '-' for cost
# Perform TOPSIS analysis
topsis(data_file, weights, impacts, "output.csv")
Output
The output will be saved as a CSV file (e.g., output.csv) containing the rankings and performance scores:
| Alternative | Score | Rank |
|---|---|---|
| A1 | 0.75 | 1 |
| A2 | 0.65 | 2 |
Parameters
- data_file: Path to the input CSV file.
- weights: List of weights for each criterion. The weights should sum up to 1.
- impacts: List of impacts for each criterion ('+' for benefit and '-' for cost).
- output_file: Path to save the output CSV file.
Example Dataset
An example dataset (data.csv) might look like this:
Alternative,Price,Quality,Durability
A1,25000,4,7
A2,20000,3,9
A3,30000,5,6
How it Works
- Normalization: The dataset is normalized to make all criteria comparable.
- Weighting: Each criterion is weighted according to its importance.
- Ideal Solutions: The ideal (best) and negative ideal (worst) solutions are calculated.
- Ranking: Alternatives are ranked based on their similarity to the ideal solution.
License
This project is licensed under the MIT License. See the LICENSE file for details.
Contributing
Contributions are welcome! Please open an issue or submit a pull request for enhancements or bug fixes.
Contact
For questions or support, please contact:
Minal Jain
GitHub
LinkedIn
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_minal_102203788-0.1.tar.gz.
File metadata
- Download URL: topsis_minal_102203788-0.1.tar.gz
- Upload date:
- Size: 4.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
26ffe473b730d0c38aeb4ff36e97b5ea9de547224d8e4e79834081e6c1fbc3a0
|
|
| MD5 |
02b64cd2ec410aa463921321d1b250b2
|
|
| BLAKE2b-256 |
b2417b1ef0b4da5bed9ddcfeb3b121820dd422d2af305f7dd4649789506bcca0
|
File details
Details for the file Topsis_Minal_102203788-0.1-py3-none-any.whl.
File metadata
- Download URL: Topsis_Minal_102203788-0.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b55d8020b41c7d204628b8f4cd211038f63be10f38d24a5cec0db9ed3d21aaf
|
|
| MD5 |
7ca9e61675dab5ee52ce2e37d0176bc4
|
|
| BLAKE2b-256 |
5297fd8b169bb7a6830b4cbc6f8e035805c33e56303e0bec85573a265952e813
|