topsis
Project description
TOPSIS Package in Python
Submitted by: Kartik Madan
Roll no: 102003565
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-kartik-102003565 can be run though the command line as follows:
>> pip install topsis-kartik-102003565
>>python topsis data.csv "1,1,1,1" "+,+,-,+" result
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.
Fund Name | P1 | P2 | P3 | P4 |
---|---|---|---|---|
M1 | 250 | 16 | 12 | 5 |
M2 | 200 | 16 | 8 | 3 |
M3 | 300 | 32 | 16 | 4 |
M4 | 275 | 32 | 8 | 4 |
M5 | 225 | 16 | 16 | 2 |
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
.
Sample Output
The output that generated from the following input will be:
Model | P1 | P2 | P3 | P4 | Topsis Score | Rank |
---|---|---|---|---|---|---|
M1 | 250 | 16 | 12 | 5 | 0.534277 | 3 |
M2 | 200 | 16 | 8 | 3 | 0.308368 | 5 |
M3 | 300 | 32 | 16 | 4 | 0.691632 | 1 |
M4 | 275 | 32 | 8 | 4 | 0.534737 | 2 |
M5 | 225 | 16 | 16 | 2 | 0.401046 | 4 |
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
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
Hashes for topsis-kartik-102003565-1.0.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb2d98c8cb6d5d5bf9e05d30d24977716ed04f7695bf641f8b0c5bdbc7a58bb0 |
|
MD5 | 99604fa0974cda809eae2654f233bc99 |
|
BLAKE2b-256 | 8ed441b381da0602d96ad60e1844526e0917f20930ec59b0628507b42d18344a |