Pyhon Package for TOPSIS score
Project description
TOPSIS_Aditi_101803650
With this you can calculate the TOPSIS score and RANK of the data provided in '.csv' format.
- Input file:
- contain three or more columns
- First column is the object/variable name.
- From 2nd to last column contain numeric values only
Overview
- You can check intermediate steps as well as the final score i.e it provides functions to calculate normalized matrix, weight normalized decision matrix , ideal best , ideal worst lists and so on.
Usage
In the following paragraphs, I am going to describe how you can get and use TOPSIS for your own projects.
Getting it
To download TOPSIS, either fork this github repo or simply use Pypi via pip.
$ pip install TOPSIS_Aditi_101803650
Using it
TOPSIS was programmed with ease-of-use in mind. Just, import topsis from TOPSIS-Aditi-101803650
from TOPSIS_Aditi_101803650 import topsis
And you are ready to go!
topsis
There are 5 functions in this:
- normalized_matrix
- weight_normalized
- ideal_best_worst
- euclidean_distance
- topsis_score
normalized_matrix()
This function takes location of the input file as parameter and returns normalized decision matrix.
weight-normalized()
This function takes location of the input file as well as the weights corresponding to columns in file. No. of weights should be equal to the no. of columns(from 2nd to last column). It returns weight normalized decision matrix.
ideal_best_worst()
This takes location of input file, weights and impacts as parameters. Impact should either be "+" or "-" and should be separated by ",". No. of impacts should also be equal to the no. of columns(from 2nd to last column). It return two lists: one with ideal best values and the other with ideal worst values corresponding to every column.
euclidean_distance()
This takes same input as that of ideal_best_worst() function but returns two lists:
- Euclidean distance from ideal best
- Euclidean distance from ideal worst
topsis_score()
This also takes the same input as the previous function but returns matrix with the same columns as input file and two more columns named 'Topsis Score' and 'Rank'.
So any function can be used in the below format:
topsis.function_name(parameters)
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
File details
Details for the file TOPSIS_Aditi_101803650-0.2.tar.gz.
File metadata
- Download URL: TOPSIS_Aditi_101803650-0.2.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.2.0 pkginfo/1.6.1 requests/2.25.0 setuptools/47.1.0 requests-toolbelt/0.9.1 tqdm/4.51.0 CPython/3.8.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ed73aae1de54d9d2b47b460a5d8829d30c481e579bdc331cd5666546a28f3bd
|
|
| MD5 |
e073f2d979c4025a43d3bd1614f51629
|
|
| BLAKE2b-256 |
db3445ce2c6fe9757efe5b0388c5e78ddf88e40c61ed47aeec378332da17c267
|