Skip to main content

TOPSIS implementation as a Python package

Project description

TOPSIS Python Package

Topsis-Paridhi-102303715 is a Python package for solving Multiple Criteria Decision Making (MCDM) problems using the Technique for Order Preference by Similarity to Ideal Solution (TOPSIS)**.

This package allows users to rank alternatives based on multiple criteria by providing:

  • a CSV input file
  • a weight vector
  • an impact vector

The package computes the TOPSIS score and rank for each alternative.


Installation

Use the package manager pip to install the package:

pip install Topsis-Paridhi-102303715

Input Parameters

  1. Weights Vector A comma-separated list of numeric values representing the importance of each criterion. Example: 0.25,0.25,0.25,0.25

  2. Impacts Vector A comma-separated list of impacts where:

  • "+" indicates a beneficial criterion
  • "-" indicates a non-beneficial criterion

Example: +,+,-,+

Usage:

topsis <input_file.csv> "<weights>" "<impacts>" <output_file.csv>

Example topsis sample.csv "0.25,0.25,0.25,0.25" "+,+,-,+" output.csv

Output

The output file is a CSV file containing:

  • original input columns
  • Topsis Score
  • Rank

Sample Output

TOPSIS RESULTS

Item Similarity Score Rank
A 1.000000 1
C 0.976532 2
B 0.845210 3

Higher TOPSIS score indicates a better alternative.

Input File Format:

Input file must be a CSV file:

  • First column should contain alternative names
  • Remaining columns must contain numeric values only
  • File must contain at least 3 columns

Example sample.csv

Item Feature1 Feature2 Feature3
A 10 7 9
B 8 6 5
C 9 9 8

Validation Rules:

The program performs the following validations:

  • Input file existence check
  • Minimum column count check
  • Numeric value validation
  • Equal number of weights, impacts, and criteria
  • Impacts must be either + or -
  • Weights and impacts must be comma-separated
  • Appropriate error messages are displayed if invalid input is detected.

License

This project is licensed under the MIT License.

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_paridhi_102303715-1.0.3.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

topsis_paridhi_102303715-1.0.3-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file topsis_paridhi_102303715-1.0.3.tar.gz.

File metadata

File hashes

Hashes for topsis_paridhi_102303715-1.0.3.tar.gz
Algorithm Hash digest
SHA256 a3c27702d510bcd8ddb68fddf685f9fa25e8192d73223d3d75d5ecac44c422f3
MD5 875a93c040b8057191b9be25cf318dbd
BLAKE2b-256 b9f3bb348b8c757033288e5e538f46600877d4fd25f058579e7d6fad30eeee5b

See more details on using hashes here.

File details

Details for the file topsis_paridhi_102303715-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_paridhi_102303715-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e5b9d2c8821cdcfb1e337b71f44588dba9f08f05ffa2cc5568bd60e8555258e0
MD5 94d8f0bc435d7086ee46d7298edd0d64
BLAKE2b-256 5953fe03c3a17e23b1031b878fb0fdf2696f69d61ff16c2dc7e1af19c88dba24

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