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

Uploaded Python 3

File details

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

File metadata

  • Download URL: topsis_yash_102303796-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 689fb0af8da7fea2073a3dfc45e1c68e80c3696bcad11dd89bd400d1780c9e1b
MD5 e457035652916b825f1476157f70e196
BLAKE2b-256 762f5c69b396fdde50ea5b4149f089ac3e74ca557dff289083755c9658d2b3e0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for topsis_yash_102303796-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 00c40eb1ff46a28179997faddd762b88f3bf6da2c9fc62afb062ce456ceefc1b
MD5 c3568290583da3285e0f743fac2770f8
BLAKE2b-256 0bc44f0da545f8f9602af324d33ce12b36495496a6cdf32f84c72812fbde8908

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