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.4

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.4.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.4-py3-none-any.whl (2.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: topsis_yash_102303796-1.0.4.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.4.tar.gz
Algorithm Hash digest
SHA256 e4ea5e0b18dac3d06bd8d277211afd66d467697ff778657e17835a56b7e6ce28
MD5 51e727aa84b02e15929b8fc1e98ddf95
BLAKE2b-256 42e0d3089d1124019112287df4249ed55c2324082a90cb2ade16fe0333b69103

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for topsis_yash_102303796-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 e2604a18a5cb3d47c11726d3487828556861434f3b9fbc83c2c5c3187c21f935
MD5 00583b2c190afd03c01220a12442a018
BLAKE2b-256 7e63ed80468b6289c54eab28eabe53fdefadd31dfdb7c826a09daed1310257a1

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