Skip to main content

A Python package for TOPSIS method

Project description

TOPSIS

Author: Saanchi gupta Roll Number: 102303323


Overview

TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) is a multi-criteria decision-making (MCDM) method developed in the 1980s.
It ranks alternatives based on their relative closeness to the ideal best and ideal worst solutions.

This package provides a command-line implementation of the TOPSIS algorithm and supports CSV input files.


Installation

Install the package using pip:

pip install Topsis-Saanchi-102303323


Command Line Usage

After installation, run the following command in the current working directory:

topsis

Example

topsis data.csv "1,2,1,1" "+,-,-,+" result.csv


Input Requirements

  • Input file must contain three or more columns
  • First column must contain alternative names (non-numeric)
  • Second to last columns must contain numeric values only
  • Number of weights, impacts, and criteria columns must be equal
  • Impacts must be:
    • + for benefit criteria
    • - for cost criteria
  • Weights and impacts must be comma-separated
  • Weights need not be normalized (handled internally)

Input File Format (data.csv)

Each row represents an alternative, and each column (except the first) represents a decision criterion such as Correlation, R², RMSE, Accuracy, etc.

Example:

Model Corr Rseq RMSE Accuracy
M1 0.79 0.62 1.25 60.89
M2 0.66 0.44 2.89 63.07
M3 0.56 0.31 1.57 62.87
M4 0.82 0.67 2.68 70.19
M5 0.75 0.56 1.30 80.39

Output File Format (result.csv)

For weights "1,2,1,1" and impacts "+,-,-,+", the output file will contain two additional columns: Topsis Score and Rank.

Example Output

Model Corr Rseq RMSE Accuracy Topsis Score Rank
M1 0.79 0.62 1.25 60.89 0.423744391359611 4
M2 0.66 0.44 2.89 63.07 0.467426368298297 3
M3 0.56 0.31 1.57 62.87 0.760230957034903 1
M4 0.82 0.67 2.68 70.19 0.207772533881566 5
M5 0.75 0.56 1.30 80.39 0.504864457803718 2

Description of Output

  • Topsis Score: Relative closeness of the alternative to the ideal solution
  • Rank: Rank based on TOPSIS score (1 = best alternative)

License

This project is developed for academic purposes.

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_saanchi_102303323-0.0.5.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

topsis_saanchi_102303323-0.0.5-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file topsis_saanchi_102303323-0.0.5.tar.gz.

File metadata

File hashes

Hashes for topsis_saanchi_102303323-0.0.5.tar.gz
Algorithm Hash digest
SHA256 ca827f33e01a99c5a9a4f9115da4496a180abc1dc8728768d5b4840074c8f984
MD5 c76b2e89c447b816a5d5dbd7830cfc77
BLAKE2b-256 4ff56732ba891725caab751e6fe52f2de894fab0c2b298ed6718eebf21cbf51a

See more details on using hashes here.

File details

Details for the file topsis_saanchi_102303323-0.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_saanchi_102303323-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 6d927225db40c238a2c0cba69cbb0b162ed7dec093a67d047e669edf67a510ea
MD5 a11591ba1d668049999d21032a9bcceb
BLAKE2b-256 625e96655280c798687abdc2a0b6aea47d114dcc3d3e4029e618d17889b26a54

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