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.2.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.2-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for topsis_paridhi_102303715-1.0.2.tar.gz
Algorithm Hash digest
SHA256 03af2b9f0496744c58075825b9d486eba4a83f4bb1e56bc6b1fbbbfcdad8b1f4
MD5 9702183ea74bc9f4eb80f97ed6ce9fce
BLAKE2b-256 fe60490d71879962ea5ba2c6d3038f9f14a86d42f0f2c8fb22419aef91e885c1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for topsis_paridhi_102303715-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 f05dabe99c9755a524702aa487b4b2e1b24b6d9e7321b90a639ddc4ccb3a6b6a
MD5 35d0bec705bf5fb99823723cb751250d
BLAKE2b-256 d285c48e6f904a3e9d2568100dacd5429e0e61f190307044cb91f9af8b0e38af

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