Skip to main content

Find the Topsis Score Easily

Project description

TOPSIS-KUNAL-101803623

TOPSIS-KUNAL-101803623 is a package that will provide feature to do multi-criteria decision making in choosing the best models among the data provided.

  • It will provide with the TOPSIS Score.
  • It will do Ranking of Models on the basis of the given data.

TOPSIS:

Technique for Order Preference by Similarity to Ideal Solution (TOPSIS) originated in the 1980s as a multi-criteria decision making method. TOPSIS chooses the alternative of shortest Euclidean distance from the ideal solution, and greatest distance from the negative-ideal solution.

Installation

TOPSIS-KUNAL-101803623 requires Python v2.7+ to run.

Install the package using pip as follows :

$ pip install TOPSI-KUNAL-101803623

HOW TO USE THIS PACKAGE

TOPSIS-KUNAL-10803623 can be run as in the following examples:

IN PYTHON IDLE :

NOTE:

  1. Pre-processing is to be done only in-case of non-numeric data in input file.
  2. Ensure that the number of weights and impacts is equal to the no of columns excluding the first one in the preprocesed data.
>>> import pandas as pd
>>> from topsis import TopsisScore
>>> dataset = pd.read_csv('data.csv') #data.csv the file containing the input data
>>> dataset = prepocess(dataset) # Preprocessing as mentioned above of data
>>> w = [1,1,1,2] 
>>> im = ['+','+','-','+'] 
>>> """checking the no of weights and imapcts should be equal to no of columns in dataset  
>>>    excluding the first column in the preprocessed dataset """
>>> noofparameterreq = len(dataset.columns)-1
>>> if (len(weights) != noofparameterreq) or (len(impacts) != noofparameterreq) :
>>>     print("The no of parameters required for weights and impacts is : " +                   
        str(noofparameterreq))
        raise Exception('Inavalid no of parameters in weights or impacts')
>>> dataset = TopsisScore(dataset,w,im)
>>> print(dataset) #returns pandas dataframe with rank and topsis score included 

Sample Dataset

The decision matrix (a) will be extracted from the csv file as the pandas dataframe which will contain each row representing a Model alternative, and each column representing a criterion like Accuracy, RSeq, Root Mean Squared Error, Correlation, and many more.

Model Correlation RSeq 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 (w) is not already normalised will be normalised later in the code. Information of impacts positive(+) or negative(-) impact criteria should be provided in (im).

No of weights and no of impacts should be equal to no. of columns in dataset excluding the first column

Sample Output

The rankings are displayed in the form of a table, with the 1st rank offering us the best decision, and last rank offering the worst decision making, according to TOPSIS method.

Model Correlation RSeq RMSE Accuracy Topsis Score Rank
M1 0.79 0.62 1.25 60.89 0.639133 2
M2 0.66 0.44 2.89 63.07 0.212592 5
M3 0.56 0.31 1.57 62.87 0.407846 4
M4 0.82 0.67 2.68 70.19 0.519153 3
M5 0.75 0.56 1.3 80.39 0.828267 1

License

MIT License

Copyright (c) 2020 Kunal Pradyuman

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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-KUNAL-101803623-0.0.1.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

TOPSIS_KUNAL_101803623-0.0.1-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file TOPSIS-KUNAL-101803623-0.0.1.tar.gz.

File metadata

  • Download URL: TOPSIS-KUNAL-101803623-0.0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.5

File hashes

Hashes for TOPSIS-KUNAL-101803623-0.0.1.tar.gz
Algorithm Hash digest
SHA256 e51dc0c2c9e3d183d4348f1cd4da9d0c48a585424161f19ce81dd582aff4ba04
MD5 7650bad2a3763bc7b623524ba3adf7d2
BLAKE2b-256 d32b8bcbdfaca6ea3ecb4402e2272bf08afcde0fd623a0dc13cbf1e3446422d5

See more details on using hashes here.

File details

Details for the file TOPSIS_KUNAL_101803623-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: TOPSIS_KUNAL_101803623-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/49.2.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.5

File hashes

Hashes for TOPSIS_KUNAL_101803623-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f30b377f3ded3e1a64fc473dd36848fe37584084b7778f7f7be2b83a4a87d6ca
MD5 3366851dd832f431fae25a3fea9574ff
BLAKE2b-256 75166df756ce038f5a0482ac24baf6bf12b969fcb1aaed439b5dda5fab6d2daa

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