Skip to main content

A Python package for TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution)

Project description

102203525_TOPSIS

102203525_TOPSIS is a Python package that implements the TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution) method, which is a multi-criteria decision analysis method. This package allows users to calculate TOPSIS scores and ranks for given datasets.

Installation

You can install the package using pip:

pip install 102203525_TOPSIS

Command-Line Usage

After installation, you can use the run-topsis command to perform the analysis.

Command Syntax

run-topsis <input_data_file> <weights> <impacts> <result_file_name>
  • <input_data_file>: Path to the input data file (CSV or Excel).
  • <weights>: Comma-separated list of weights for each criterion.
  • <impacts>: Comma-separated list of impacts for each criterion (+ for beneficial, - for non-beneficial).
  • <result_file_name>: Path to save the result file (CSV or Excel).

Sample Command

run-topsis data/input.xlsx "0.4,0.3,0.2,0.1" "+,+,-,+" result/output.xlsx

How It Works

  1. Data Loading: The script reads the input data from the specified file.
  2. Normalization: Each column is normalized to make the data comparable.
  3. Weighting: The normalized data is weighted according to the provided weights.
  4. Ideal Solutions: Ideal best and worst solutions are determined based on the impacts (+ or -).
  5. Separation Measures: The distance of each alternative from the ideal best and worst solutions is calculated.
  6. TOPSIS Score: The relative closeness to the ideal solution is computed.
  7. Ranking: Alternatives are ranked based on their TOPSIS scores.

Example

Input Data (input.xlsx):

Alternative Criterion 1 Criterion 2 Criterion 3 Criterion 4
A 250 16 12 5
B 200 20 8 3
C 300 11 15 7
D 275 15 10 4

Running the Command:

run-topsis input.xlsx "0.4,0.3,0.2,0.1" "+,+,-,+" output.xlsx

Result Data (output.xlsx):

Alternative Criterion 1 Criterion 2 Criterion 3 Criterion 4 topsis_scores rank
A 250 16 12 5 0.691 2
B 200 20 8 3 0.437 4
C 300 11 15 7 0.824 1
D 275 15 10 4 0.620 3

By following the above steps, you can easily perform TOPSIS analysis using the 102203525_TOPSIS package. For any issues or suggestions, feel free to open an issue on the GitHub repository.

The Link to this Python Package on PyPi

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

102203525_TOPSIS-0.1.3.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

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

102203525_TOPSIS-0.1.3-py3-none-any.whl (5.9 kB view details)

Uploaded Python 3

File details

Details for the file 102203525_TOPSIS-0.1.3.tar.gz.

File metadata

  • Download URL: 102203525_TOPSIS-0.1.3.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.9

File hashes

Hashes for 102203525_TOPSIS-0.1.3.tar.gz
Algorithm Hash digest
SHA256 e495566ec914e555dfc80cfe93b48b8c2c8b43f09867f87a1b7d768da69d3c9c
MD5 75d2f53304ba067493af702b087431f2
BLAKE2b-256 bace3601616bd9c5bf89ad89df242c0b007bfca7a79319e077da5b8c19f1e8ab

See more details on using hashes here.

File details

Details for the file 102203525_TOPSIS-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for 102203525_TOPSIS-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 318afd2ee759624cb32612295e546d456482cd1c512068d97f14c7517e6a4810
MD5 6f25d6656b8641732977240057cb24ec
BLAKE2b-256 880b7bb228f8fab648da87722c5e41657ac726b82118ccec5ea1ca7f228ef0d1

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