Skip to main content

Calculate TOPSIS Ranks

Project description

TOPSIS

Assignment for UCS654


Samarth Varshney

101903793

3CO17

What is TOPSIS?

TOPSIS stands for "The Technique for Order of Preference by Similarity to Ideal Solution" is a multi-criteria decision analysis method, which was originally developed by Ching-Lai Hwang and Yoon in 1981 with further developments by Yoon in 1987, and Hwang, Lai and Liu in 1993. TOPSIS chooses the alternative of shortest Euclidean distance from the ideal solution, and farthest distance from the negative-ideal solution. More details at wikipedia. The TOPSIS algorithm is succinctly explained in this [paper comparing TOPSIS and VIKOR methods]https://www.sciencedirect.com/science/article/abs/pii/S0377221703000201)

How do I use TOPSIS?

First, install the TOPSIS module using pip. pip install Topsis-Samarth-101903793

Then, run the TOPSIS file with the arguements - python Topsis-Samarth-101903793 101903793-data.csv 1,2,2,1 +,-,+,- 101903793-result.csv

Here, the first arguement after the python program is your subject dataframe is stored in csv format in data.csv. The second arguement is the weights you are assigning to each feature of the dataset. The default weights are 1. The third arguement are the assigned impacts. The default impact is '+'. The fourth argument is the filename in which the output table is to be stored. If no file name is given then '101903793-data.csv' file is chosen.

Output is the csv file of the model with TOPSIS Score and TOPSIS Rank.

Example

Running command -

python Topsis-Samarth-101903793 101903793-data.csv 2,2,3,3,4 -,+,-,+,- 101903793-result.csv

Input Dataset - (101903793-data.csv)

Fund Name P1 P2 P3 P4 P5
M1 0.68 0.46 5 38.5 11.16
M2 0.78 0.61 5 30.6 9.25
M3 0.79 0.62 6.9 34.9 10.8
M4 0.82 0.67 6.2 36.1 10.95
M5 0.64 0.41 6.7 46.8 13.64
M6 0.63 0.4 7 59.5 16.88
M7 0.77 0.59 4 45.3 12.67
M8 0.79 0.62 3.9 33.6 9.73

Weights -> 2,2,3,3,4 Impacts -> -,+,-,+,-

Output Dataset - (stored in 101903793-result.csv)

Fund Name P1 P2 P3 P4 P5 Topsis Score Rank
M1 0.68 0.46 5 38.5 11.16 0.545126218 4
M2 0.78 0.61 5 30.6 9.25 0.561913424 3
M3 0.79 0.62 6.9 34.9 10.8 0.469000051 6
M4 0.82 0.67 6.2 36.1 10.95 0.50574866 5
M5 0.64 0.41 6.7 46.8 13.64 0.405123307 7
M6 0.63 0.4 7 59.5 16.88 0.404922284 8
M7 0.77 0.59 4 45.3 12.67 0.60568518 2
M8 0.79 0.62 3.9 33.6 9.73 0.607093772 1

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

Topsis-Samarth-101903793-1.0.1.tar.gz (4.3 kB view details)

Uploaded Source

File details

Details for the file Topsis-Samarth-101903793-1.0.1.tar.gz.

File metadata

File hashes

Hashes for Topsis-Samarth-101903793-1.0.1.tar.gz
Algorithm Hash digest
SHA256 beb2f1db59764a33f4ef688c6a15d79ba63e7a419a189048664af255469539f4
MD5 26b028d233aaa45ca188355a9e02f9a2
BLAKE2b-256 93f6ffcc156b788261c8bf35f8a581ab7b20689664de97427b1ed21c58e9b16c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page