Skip to main content

It is a topsis package.

Project description

for: Topsis_Cherish_102003647 submitted by: Cherish Mahajan Roll no: 102003647 Group: 3COE25

Topsis_Cherish_102003647 is a Python library for solving Multiple Criteria Decision Making(MCDM) problems by Technique for Order of Preference by Similarity to Ideal Solution(TOPSIS).

Installation

Use the package manager pip to install Topsis-Cherish-102003647.

pip install Topsis_Cherish_102003647

Usage

Enter csv filename followed by .csv extension, then enter the weights vector with vector values separated by commas, followed by the impacts vector with comma separated signs (+,-)

Input

And using this package in Python as :

import topsispy as tp
a =[
     [250, 16, 12, 5],
     [200, 16, 8, 3],
     [300, 32, 16, 4],
     [275, 32, 8, 4],
     [225, 16, 16, 2]
   ]
w = [0.25, 0.25, 0.25, 0.25]
sign = [-1, 1, 1, 1]
tp.topsis(a, w, sign)

The package can be used via commandline as :

$ python [package name] [path of csv as string] [list of weights as string] [list of sign as string]

Example

sample.csv

A csv file showing data for different mobile handsets having varying features.

Model Storage space(in gb) Camera(in MP) Price(in $) Looks(out of 5)
M1 16 12 250 5
M2 16 8 200 3
M3 32 16 300 4
M4 32 8 275 4
M5 16 16 225 2

weights vector = [ 0.25 , 0.25 , 0.25 , 0.25 ]

impacts vector = [ + , + , - , + ]

Output:

  TOPSIS RESULTS
  As per the given sample, the output file looks as given below :
Model Storage space(in gb) Camera(in MP) Price(in $) Looks(out of 5) Topsis Score Rank
M1 16 12 250 5 0.534277 3
M2 16 8 200 3 0.308368 5
M3 32 16 300 4 0.691632 1
M4 32 8 275 4 0.534737 2
M5 16 16 225 2 0.401046 4

Other notes

  • The first column and first row have only been omitted by the library Topsis-Cherish-102003647 before processing, in attempt to remove indices and headers. So make sure the csv follows the format as shown in sample.csv otherwise the code will have issues in working properly.
  • Make sure the csv does not contain categorical values since the code takes into account all the values which are encoded as numerical values.
  • The Topsis-Cherish-102003647 works on the sample data and calculates the topsis score according to which it provides the rank to each available option.

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_Cherish_102003647-0.3.tar.gz (5.0 kB view details)

Uploaded Source

File details

Details for the file Topsis_Cherish_102003647-0.3.tar.gz.

File metadata

  • Download URL: Topsis_Cherish_102003647-0.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.6

File hashes

Hashes for Topsis_Cherish_102003647-0.3.tar.gz
Algorithm Hash digest
SHA256 0f6e1d2c05ac4abb488f9c732d220eeaca573c613a7574bbbdc5b5e886fd8cad
MD5 faa5ac2f49eabff62e5c4831d2aa13f4
BLAKE2b-256 fb08dc6b633bbef2920decdb08e70c23e8edc83e05f439cb08509d12febf61a1

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