Skip to main content

TOPSIS implementation as a Python package

Project description

TOPSIS – Python Package

Project Description

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.1.tar.gz (3.8 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.1-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for topsis_paridhi_102303715-1.0.1.tar.gz
Algorithm Hash digest
SHA256 0090503b86369ad9a143ae25ea7c9e7573314c0efca7a0f20d80f7022170bb37
MD5 e939410b753d8387a77c9de76440ff23
BLAKE2b-256 8b75734be930102bdeaf8aa131f772cb7c4be245ebcc9b4f7aa548c6b9077c82

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for topsis_paridhi_102303715-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 4bd13c8e8770da843de967a686f295225fc8a169219440267f480558abd8d4ef
MD5 aa71c27ce7ba3a39d6e69ab094ae45eb
BLAKE2b-256 9a3c9bb2078c028411910a54d5f930a4bb946320a934a66ecd8b15283901a836

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