Skip to main content

A command-line Python package to implement the TOPSIS method.

Project description

Topsis-Rhumeet-102317171

A Python package implementing the Technique for Order of Preference by Similarity to Ideal Solution (TOPSIS) for Multi-Criteria Decision Making (MCDM). This package works as a Command Line Tool and generates an output CSV file containing the TOPSIS Score and Rank.

Installation

Install the package from PyPI using:

pip install Topsis-Rhumeet-102317171

Quick Start

Command Syntax

Once installed, you can use the topsis command directly from your terminal, following the syntax given below.

topsis <InputDataFile> <Weights> <Impacts> <ResultFileName>

Parameters

The command accepts exactly 4 parameters:

Parameter Format Example Description
Input file Path string "data.csv" Path to your CSV file
Weights Comma-separated string "1,1,1,1" Weight for each criterion
Impacts Comma-separated string "+,+,-,+" + for benefit, - for cost
Output file Path string "result.csv" Where to save results

Example Execution

Grab an input csv or excel file strictly adheres to the following structure:

  1. The file must have at least 3 columns- Candidate Identifier column followed by min. 2 criteria.
  2. The first column must contain the names/IDs of the alternatives.
  3. Criteria columns must contain only numeric values.

A sample dataset file (data1.csv) is shown below:

Model Corr 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.30 80.39

Run the following command through the terminal.

topsis data1.csv "1,1,1,1" "+,+,-,+" result1.csv

The output file (result1.csv) generated will look like this:

Model Corr Rseq RMSE Accuracy Topsis Score Rank
M1 0.79 0.62 1.25 60.89 0.7722 2
M2 0.66 0.44 2.89 63.07 0.2256 5
M3 0.56 0.31 1.57 62.87 0.4389 4
M4 0.82 0.67 2.68 70.19 0.5239 3
M5 0.75 0.56 1.30 80.39 0.8114 1

Sample input and output files are available in the sample_data/ folder.

Important Notes

  • The command accepts exactly four parameters.
  • Number of weights and impacts must match number of criteria columns.
  • Impacts must be only + or -.
  • Make sure the criteria columns must be numeric as mentioned earlier.
  • No cell should be empty.

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_rhumeet_102317171-1.0.0.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

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

topsis_rhumeet_102317171-1.0.0-py3-none-any.whl (4.6 kB view details)

Uploaded Python 3

File details

Details for the file topsis_rhumeet_102317171-1.0.0.tar.gz.

File metadata

  • Download URL: topsis_rhumeet_102317171-1.0.0.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.18

File hashes

Hashes for topsis_rhumeet_102317171-1.0.0.tar.gz
Algorithm Hash digest
SHA256 077b8223ccc2042905b866516af9b1d97fbc1ec3341473273c88369ef0bc4d9c
MD5 a7bebcb3797fbe373c42357c0c15a66a
BLAKE2b-256 a10542e9d8f5c2add3f2c1b9b73023d28f69ce4a7d870c8017977d843a332daa

See more details on using hashes here.

File details

Details for the file topsis_rhumeet_102317171-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_rhumeet_102317171-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 20319efc5355289deb34f5f4a9f70999e5849bcf2ecb2e4e5e65a113361a787b
MD5 adf8b3c91b09a63e767d71a50d4bdd79
BLAKE2b-256 76444104225a9f426c8dbe29f880ab7266bd68dc090236db42802a8698d6c63d

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