This project provides an implementation of the Technique for Order Preference by Similarity to Ideal Solution (TOPSIS), a widely-used decision-making method. The algorithm evaluates and ranks alternatives based on multiple attributes, considering the importance of each attribute (weights) and its impact type (benefit or cost).
- Validation of Inputs: Ensures proper formatting of input data, weights, and impacts for consistent processing.
- Comprehensive Error Handling: Manages issues like missing files, invalid data, and incorrect input parameters.
- Output Results: Generates a CSV file that includes original data, calculated scores, and rankings.
-
Clone the repository and navigate to the project directory.
-
Ensure Python and the required dependencies are installed.
-
Execute the program using the following command:
python -m topsis_shamma_102253003.topsis <InputDataSet.csv> <Weights> <Impacts> <Result.csv>
- Input File: A CSV file containing the dataset where each column represents an attribute, and each row represents an alternative.
- Weights: Specify the importance of each attribute as a list (e.g.,
[1, 2, 3, 4, 5]). - Impacts: Define whether each attribute is a benefit (
1) or a cost (0) (e.g.,[1, 0, 1, 1, 0]). - Output File: A CSV file with calculated TOPSIS scores and rankings.
[1, 1, 1, 1, 1]
[1, 0, 1, 0, 1]
1indicates a benefit0indicates a cost
The resulting file includes:
- Original data
- Calculated TOPSIS scores
- Rankings based on the scores
The package is available on PyPI. You can access it through the following link: