Skip to main content

This program uses command line arguments to implement Topsis : a Multi-Criteria Decision Ananlysis (MCDA) method

Project description

Project Description

Topsis

TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) is a Multi-Criteria Decision Ananlysis (MCDA) method that is used to solve multiple criteria decision making problems.

It uses the fundamental premise that the best solution has the shortest distance from the positive-ideal solution, and the longest distance from the negative-ideal one and ranks solutions that have multiple criterias.

Installation

Use pip to install:

pip install topsis-ananya-102017024

Prerequisite Libraries needed to be downloaded before running this package are :

  • Numpy
  • Pandas

Usage

Run topsis in the input file's directory as follows:

topsis <input_file_name> <weights> <impacts> <output_file_name>

For example, Use quotation marks while including spaces in any argument:

topsis data.csv "1, 1, 1, 1" "+, -, +, -" result.csv

or vectors can be entered without any space

topsis data.csv 1,1,1,1 +,-,+,- result.csv
Note that
  • Input file must contain three or more columns.
  • Except the first column of the input file the rest must be numeric
  • Weights must be numeric
  • Impacts must be either
    • + (for features that are to be maximised)
    • - (for features that are to be minimized)
  • Both Impacts & Weights must be seperated by a comma ,

Example

input.csv

Attribute Price Storage Camera Looks
M1 250 16 12 5
M2 200 16 8 3
M3 300 32 16 4
M4 275 32 8 4
M5 225 16 16 2

On running

topsis input.csv "0.25,0.25,0.25,0.25" "-,+,+,+" output.csv

output.csv

Attribute Price Storage Camera Looks Topsis Score Rank
M1 250 16 12 5 0.534269 3
M2 200 16 8 3 0.308314 5
M3 300 32 16 4 0.691686 1
M4 275 32 8 4 0.534807 2
M5 225 16 16 2 0.401222 4

License

MIT

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

Uploaded Source

File details

Details for the file topsis-Ananya-102017024-0.0.1.tar.gz.

File metadata

  • Download URL: topsis-Ananya-102017024-0.0.1.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.7

File hashes

Hashes for topsis-Ananya-102017024-0.0.1.tar.gz
Algorithm Hash digest
SHA256 34011a93ebc7779d4e0a957797a7c76243ea9ec3786920bac74c58f17042f36f
MD5 953ec507af8702a8b15581487b9bb090
BLAKE2b-256 d1ee0ae8d7c8f7ac4e681ba1c82404854990d3d44ee76f935ace990e2700fe18

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