A command line tool to perform TOPSIS, a multi-criteria decision making technique
Project description
TOPSIS
TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) is a decision-making technique applied in order to rank potential solutions on the basis of multiple criteria.
Installation
This package requires Python v3.5+ to run.
Use pip
to install:
pip install topsis-amrita-102017017
OS Compatibility
It should work on any Python implementation and operating system and is compatible with Python version 3.5 and upwards.
Usage
Run topsis
in the input file's directory as follows:
topsis <input_file_name> <weights> <impacts> <output_file_name>
For example,
topsis data.csv 1,1,1,1 +,-,+,- result.csv
Use quotation marks while including spaces in any argument:
topsis data.csv "1, 1, 1, 1" "+, -, +, -" result.csv
- Input and output file format should be .CSV
- First column in the input file should be the object name
- Input file must have at least 2 criteria, and all criterion values should be numeric
- Weights must be numeric and comma-separated. For example,
0.25,0.25,1.0,0.25
or"0.25,0.25,1.0,0.25"
. - Impacts must be comma-separated with
+
for criteria that are to be maximised, and-
for criteria that are to be minimised. For example,+,-,+,-
or"+, -, +, -"
Example
Consider input.csv:
Model | Corr | R2 | RMSE | Accuracy |
---|---|---|---|---|
M1 | 0.79 | 0.62 | 1.25 | 60.89 |
M2 | 0.66 | 0.44 | 2.89 | 63.07 |
M3 | 0.56 | 0.31 | 1.57 | 62.87 |
M4 | 0.82 | 0.67 | 2.68 | 70.19 |
M5 | 0.75 | 0.56 | 1.3 | 80.39 |
If we run the following command:
topsis input.csv "1, 1, 1, 1" "+, +, -, +" result.csv
we get a file named result.csv in the directory with an additional 2 columns containing the TOPSIS score and the rank of each object:
Model | Corr | R2 | RMSE | Accuracy | TOPSIS Score | Rank |
---|---|---|---|---|---|---|
M1 | 0.79 | 0.62 | 1.25 | 60.89 | 0.7722097345612788 | 2.0 |
M2 | 0.66 | 0.44 | 2.89 | 63.07 | 0.22559875426413367 | 5.0 |
M3 | 0.56 | 0.31 | 1.57 | 62.87 | 0.43889731728018605 | 4.0 |
M4 | 0.82 | 0.67 | 2.68 | 70.19 | 0.5238778712729114 | 3.0 |
M5 | 0.75 | 0.56 | 1.3 | 80.39 | 0.8113887082429979 | 1.0 |
License
MIT
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
File details
Details for the file Topsis-Amrita-102017017-0.0.4.tar.gz
.
File metadata
- Download URL: Topsis-Amrita-102017017-0.0.4.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00d338af75689fcd127ef35f8af8bd14092588e2fad37a5d5a9ae2cf974276ae |
|
MD5 | 6964ac1bcc58f8234fe281bae35e08b1 |
|
BLAKE2b-256 | 3c3463c44b28df7743c3296c2422d9ba69baafba56236ebe7ab50188a1a445bb |
File details
Details for the file Topsis_Amrita_102017017-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: Topsis_Amrita_102017017-0.0.4-py3-none-any.whl
- Upload date:
- Size: 5.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0064e92cfe1c9dec3faa3359af7d9becc4615976d9524eb69e087b451eb41d44 |
|
MD5 | b53b866a51d0c0079a42fc6609332040 |
|
BLAKE2b-256 | e3f38431348c93de13c5c693d59fc07cc6b1138cccd49e2e5dde1417d587e656 |