Skip to main content

No project description provided

Project description

topsis_demo: TOPSIS Analysis Python Package

Overview

topsis_demo is a Python package that implements the Technique for Order Preference by Similarity to Ideal Solution (TOPSIS) for multi-criteria decision-making (MCDM). It provides a straightforward and efficient way to evaluate and rank a set of alternatives based on conflicting criteria.

Key Features

User-friendly command-line interface for easy execution. Supports both numerical and categorical data. Handles equal weights and impacts, as well as positive and negative impacts. Generates a TOPSIS score for each alternative, indicating its similarity to the ideal solution. Provides ranking of alternatives based on their TOPSIS scores. Installation

To install topsis_demo using pip:

Bash pip install topsis_demo Use code with caution. Learn more Usage

You can use topsis_demo from the command line as follows:

Bash topsis_demo input.csv weights impacts output.csv Use code with caution. Learn more where:

input.csv: The input CSV file containing the decision matrix (alternatives and criteria). weights: Comma-separated list of weights for each criterion (numerical, equal to the number of criteria). impacts: Comma-separated list of impacts for each criterion (+ for positive, - for negative). output.csv: The output CSV file containing the TOPSIS scores and rankings. Example

Assume you have a CSV file data.csv with the following structure:

M1,0.84,0.71,6.7,42.1,12.59 M2,0.91,0.83,7.0,31.7,10.11 M3,0.79,0.62,4.8,46.7,13.23 M4,0.78,0.61,6.4,42.4,12.55 M5,0.94,0.88,3.6,62.2,16.91 M6,0.88,0.77,6.5,51.5,14.91 M7,0.66,0.44,5.3,48.9,13.83 M8,0.93,0.86,3.4,37.0,10.55

And you want to perform TOPSIS with weights 1,1,1,2,1 and all positive impacts (+++-+).

Run the following command:

Bash topsis_demo data.csv "1,1,1,2,1" "+,+,+,-,+" results.csv Use code with caution. Learn more This will create a file results.csv with the TOPSIS scores and rankings:

Fund Name P1 P2 P3 P4 P5 Topsis Scores Rank 0 M1 0.000000 0.344401 0.421434 0.645078 0.335992 0.388275 7 1 M2 0.084515 0.402609 0.440304 0.485724 0.269808 0.509098 5 2 M3 0.169031 0.300744 0.301923 0.715562 0.353072 0.383997 8 3 M4 0.253546 0.295893 0.402563 0.649675 0.334925 0.519762 4 4 M5 0.338062 0.426863 0.226442 0.953061 0.451281 0.433891 6 5 M6 0.422577 0.373505 0.408854 0.789110 0.397907 0.599615 3 6 M7 0.507093 0.213431 0.333373 0.749271 0.369084 0.602643 2 7 M8 0.591608 0.417161 0.213862 0.566933 0.281550 0.713985 1 Additional Notes

The weights and impacts must be separated by commas and have the same number of elements as the number of criteria. For more advanced usage, see the source code or consider creating a custom Python script.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

topsis_experimental-0.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file topsis_experimental-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_experimental-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 f7f7f5e6ee3cf8642b6e637d7b7fe9bd66a3dc26d41c58fc8f2749aaa7142dce
MD5 a5aba4b61e46a2bf525a8ecf20f224f1
BLAKE2b-256 2d6e1c20dbbd89921f2d1e1bd953b38faab541154940acd960121798555acec5

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