This package can be used to calculate the topsis score of multiple component data and rank them accordingly
Project description
TOPSIS Package in Python
Submitted by: Satyam Verma
Roll no: 101803324
UCS538
TOPSIS
TOPSIS is an acronym that stands for ‘Technique of Order Preference Similarity to the Ideal Solution’ and is a pretty straightforward MCDA method. As the name implies, the method is based on finding an ideal and an anti-ideal solution and comparing the distance of each one of the alternatives to those.
How to use
The package Topsis-Satyam-101803324 can be run though the command line as follows:
>> pip install Topsis-Satyam-101803324
>>topsis data.csv "1,1,1,1" "+,+,-,+" result.csv
Sample Input
The decision matrix should be constructed with each row representing a Model alternative, and each column representing a criterion like Accuracy, R2, Root Mean Squared Error, Correlation, and many more.
| Model | Correlation | 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 |
Weights `weights` is not already normalised will be normalised later in the code.
Information of benefit positive(+) or negative(-) impact criteria should be provided in impacts.
Output of this sample input
The output that will be generated from the following input data will be:
| Model | Correlation | 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 |
The output file contains columns of input file along with two additional columns having **Topsis_score** and **Rank** . Here the ranks are given as rank 1 is the best solution according to the weights and impacts given and rank 5 is the worst solution.
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
File details
Details for the file Topsis-Satyam-101803324-1.0.5.tar.gz.
File metadata
- Download URL: Topsis-Satyam-101803324-1.0.5.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.24.0 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.6rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1532d17b1b97a874e909dc533c150c504c5158bbe0f2cbbf31268bc4dde9919d
|
|
| MD5 |
135612e9382c719a926ed6a46c7766d2
|
|
| BLAKE2b-256 |
8838329df4843e5c933af0db64c023fecb3d62ec963212861231d879aaa35b8c
|