A Python package implementing TOPSIS technique.
Project description
TOPSIS-Python
Assignment 6: UCS538
Submitted By: DIVYAM JAIN-101803128
What is 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. More details at wikipedia.
How to use this package:
TOPSIS-Divyam-101803128 can be run as in the following example:
Python Script
from topsis_101803128.topsis import CalcTopsisScore
filename = "input.csv"
weight = "1,1,1,2"
impact = "+,+,-,+"
CalcTopsisScore(filename, weight, impact )
Sample dataset
The decision matrix (a) 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 (w) is not already normalised will be normalised later in the code.
Information of benefit positive(+) or negative(-) impact criteria should be provided in I.
Output
| Model | Correlation | R2 | RMSE | Accuracy | Score | Rank |
|---|---|---|---|---|---|---|
| M1 | 0.79 | 0.62 | 1.25 | 60.89 | 0.77221 | 2 |
| M2 | 0.66 | 0.44 | 2.89 | 63.07 | 0.225599 | 5 |
| M3 | 0.56 | 0.31 | 1.57 | 62.87 | 0.438897 | 4 |
| M4 | 0.82 | 0.67 | 2.68 | 70.19 | 0.523878 | 3 |
| M5 | 0.75 | 0.56 | 1.3 | 80.39 | 0.811389 | 1 |
The rankings are displayed in the form of a table using a package 'tabulate', with the 1st rank offering us the best decision, and last rank offering the worst decision making, according to TOPSIS method.
License
© 2020 Divyam Jain
This repository is licensed under the MIT license. See LICENSE for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file topsis_101803128-1.4.tar.gz.
File metadata
- Download URL: topsis_101803128-1.4.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b828232e49f5ea6421bef39ba27ef151ab427248c3605957824cc14ddf12b683
|
|
| MD5 |
0782275f8b0eb21f77f325030a06fbb6
|
|
| BLAKE2b-256 |
bccf3f9270f190b9850ad5bcc589de2544b29c7e2a9b15c6daef09ee0f09ad49
|
File details
Details for the file topsis_101803128-1.4-py3-none-any.whl.
File metadata
- Download URL: topsis_101803128-1.4-py3-none-any.whl
- Upload date:
- Size: 5.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/50.3.2 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.6.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
edf681c579469f446a6285a7baaa975cda4b302d8b21f659fb6904c5846bd2fb
|
|
| MD5 |
6fea34438738b8c931ef910be95ae615
|
|
| BLAKE2b-256 |
03debad2f1cc70ef4f8ba3b49652a25264463d8bba4b997b6b72530b5c0fdf47
|