Skip to main content

TOPSIS implementation with CLI support

Project description

TOPSIS

Author: Mukul Ghai Roll Number: 102303463


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-Mukul-102303463


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_mukul_102303463-0.0.0.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

topsis_mukul_102303463-0.0.0-py3-none-any.whl (4.4 kB view details)

Uploaded Python 3

File details

Details for the file topsis_mukul_102303463-0.0.0.tar.gz.

File metadata

  • Download URL: topsis_mukul_102303463-0.0.0.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for topsis_mukul_102303463-0.0.0.tar.gz
Algorithm Hash digest
SHA256 ed4f721e6a66ad833dddab10e1fc370470a92b8794a59ce34558298ed1d3e479
MD5 049c4060db596857a148ac1524951576
BLAKE2b-256 af81ba4306c317da145ad6192520beb143e0b26271953e89a92f5d60277f2856

See more details on using hashes here.

File details

Details for the file topsis_mukul_102303463-0.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_mukul_102303463-0.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8864e15e546f810e9c8acf3950165d518573ab0e8bf0f9f504c1745f46afcac4
MD5 34eb9cd71589e129557c3770cf2e9b1e
BLAKE2b-256 5b7530c69e594d97acb87520759e23580b692dc4bf9d13fc3d375652300c9b01

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