Skip to main content

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

Project description

TOPSIS – Python Package

Project Description

topsis-yash-102303796 is a Python package that implements
TOPSIS (Technique for Order Preference by Similarity to Ideal Solution),
a popular Multi-Criteria Decision Making (MCDM) technique.

This package ranks alternatives based on multiple numeric criteria, user-defined weights, and impacts.

This project is developed as part of an academic assignment.


Installation

Install the package using pip:

pip install topsis-yash-102303796==1.0.3

Usage

Enter csv filename followed by .csv extentsion, then enter the weights vector with vector values separated by commas, followed by the impacts vector with comma separated signs (+,-)

topsis <input_file.csv> <weights> <impacts> <output_file.csv>

Parameters

  1. input_file.csv CSV file containing alternatives and criteria (first column = names, remaining columns = numeric values)

  2. weights Comma-separated numeric values Example:

1,1,1,1,1
  1. impacts Comma-separated signs (+ for benefit, - for cost) Example:
+,+,-,+,+
  1. output_file.csv Output CSV file generated by the program

Example

Sample Input File (data.csv)

Fund Name P1 P2 P3 P4 P5
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

Command

topsis input.csv "1,1,1,1,1" "+,+,+,+,+" output.csv

Sample Output (output.csv)

Fund Name P1 P2 P3 P4 P5 Topsis Score Rank
M1 0.84 0.71 6.7 42.1 12.59 0.5636923298 3
M2 0.91 0.83 7.0 31.7 10.11 0.5130321034 4
M3 0.79 0.62 4.8 46.7 13.23 0.4391772826 6
M4 0.78 0.61 6.4 42.4 12.55 0.4919560825 5
M5 0.94 0.88 3.6 62.2 16.91 0.6418858152 2
M6 0.88 0.77 6.5 51.5 14.91 0.7381481319 1
M7 0.66 0.44 5.3 48.9 13.83 0.4073895318 8
M8 0.93 0.86 3.4 37.0 10.55 0.4084986767 7

Notes

  1. Input CSV must contain numeric values only (except first column)
  2. Number of weights must match number of criteria columns
  3. Impacts must be either + or -
  4. Input and output files must be in the current working directory
  5. The package does not include sample CSV files

Author

Yash Raghuvanshi Roll Number: 102303796

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_yash_102303796-1.0.3.tar.gz (2.5 kB view details)

Uploaded Source

Built Distribution

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

topsis_yash_102303796-1.0.3-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

Details for the file topsis_yash_102303796-1.0.3.tar.gz.

File metadata

  • Download URL: topsis_yash_102303796-1.0.3.tar.gz
  • Upload date:
  • Size: 2.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for topsis_yash_102303796-1.0.3.tar.gz
Algorithm Hash digest
SHA256 88dc7d536e78a5361e62e2a734d475e6d02b195fd00912f3569e87d67f222d1a
MD5 fb1071a5fb026f739743d0c385137699
BLAKE2b-256 069ecc95e6a628e538614a6042f5dc5fb0d45e51fecb3addb4aaf93fbbebfe24

See more details on using hashes here.

File details

Details for the file topsis_yash_102303796-1.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_yash_102303796-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9623bfa5c14e0c34252e58aab87ce09bd761ab352f7e49c351d439c088966a82
MD5 074df59715bc0a1569f2d310eec85fe3
BLAKE2b-256 981d995680225c4268192719fb74083e92cc5c5d490ee308af6ed46144743c41

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