Skip to main content

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: Khushleen Billing

Roll no: 101803162

UCS538


Concept of 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-Khushleen-101803162 can be run though the command line as follows:

>> pip install TOPSIS-Khushleen-101803162==0.3.0
>> python
>>>from topsis_analysis.topsispackage import topsis
>>>topsis("data.csv","1,1,1,2","+,+,-,+","output.csv")

Note:

  • Usages:

    topsis( <InputDataFile> <Weights> <Impacts> <ResultFileName>)

  • Input File:

    • Input file contain three or more columns.
    • First column is the object/variable name (e.g. M1, M2, M3, M4……) .
    • From 2nd to last columns contain numeric values only.
  • Output File:

    • Result file contains all the columns of input file and two additional columns having TOPSIS SCORE and RANK
  • The output is created in the form of csv file and stored and also it is displayed.

  • The impacts given in the command line should be either ‘+’ or ‘–’ depending if you want to maximise the column parameter or minimise it.

Sample Input

Here is a sample set of data which can be used for the following package:

ModelCorrelationR2RMSEAccuracy
M10.790.621.2560.89
M20.660.442.8963.07
M30.560.311.5762.87
M40.820.672.6870.19
M50.750.561.380.39

Output of this sample input

The output that will be generated from the following input data will be:

ModelCorrelationR2RMSEAccuracyTopsis ScoreRank
M10.790.621.2560.890.63913301413425902.0
M20.660.442.8963.070.212591829692779005.0
M30.560.311.5762.870.40784567761305204.0
M40.820.672.6870.190.51915323950074703.0
M50.750.561.380.390.82826658519358101.0

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

TOPSIS-Khushleen-101803162-0.3.0.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file TOPSIS-Khushleen-101803162-0.3.0.tar.gz.

File metadata

  • Download URL: TOPSIS-Khushleen-101803162-0.3.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.0.0.post20200309 requests-toolbelt/0.9.1 tqdm/4.50.2 CPython/3.7.6

File hashes

Hashes for TOPSIS-Khushleen-101803162-0.3.0.tar.gz
Algorithm Hash digest
SHA256 ffc695e8cd0a73f50995dab35d05664ecd0748cd34d181b39c2d9f67a6075de3
MD5 fde101b8e2a08f7999af29f85cfde140
BLAKE2b-256 52e8d00daf01147ffaabac8c44090f1c4d97831b8817bb3fd774d187dc06f070

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