Skip to main content

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

Project description

Topsis-AryanSaini-102303666

This package is built as a submission to Assignment 1

Submitted by: Aryan Saini (102303666)

Definition: TOPSIS, acronym for Technique for Order Preference by Similarity to Ideal Solution, is a multi-criteria decision-making (MCDM) method used to rank alternatives by selecting the option that is closest to the ideal solution and farthest from the worst (negative ideal) solution.


Installation

Use the package manager pip to install Topsis-AryanSaini-102303666

pip install Topsis-AryanSaini-102303666

⚙️ Usage

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

where,

  • data.csv is your input file
  • Weights to be assigned to each feature
  • Impacts to optimize each feature ('+': Maximize, '-': Minimize)
  • Output file path to save the results

🪴Example

weights = [1,1,1,1,1] impacts = [+,+,-,+,+]

Input Dataset TOPSIS Output

📄 data.csv

Fund Name P1 P2 P3 P4 P5
M1 0.75 0.56 3.9 41.1 11.58
M2 0.73 0.53 3.4 61.1 16.44
M3 0.65 0.42 5.2 64.5 17.69
M4 0.77 0.59 3.8 40.6 11.44
M5 0.81 0.66 5.3 38.1 11.22
M6 0.81 0.66 5.5 57.3 16.07
M7 0.87 0.76 6.7 51.5 14.96
M8 0.94 0.88 5.5 67.9 18.81

📊 result.csv

Fund Name P1 P2 P3 P4 P5 Topsis Score Rank
M1 0.75 0.56 3.9 41.1 11.58 0.4086 7
M2 0.73 0.53 3.4 61.1 16.44 0.5806 2
M3 0.65 0.42 5.2 64.5 17.69 0.4485 5
M4 0.77 0.59 3.8 40.6 11.44 0.4303 6
M5 0.81 0.66 5.3 38.1 11.22 0.3549 8
M6 0.81 0.66 5.5 57.3 16.07 0.5226 3
M7 0.87 0.76 6.7 51.5 14.96 0.4648 4
M8 0.94 0.88 5.5 67.9 18.81 0.7283 1

🗒️ Notes

The package handles the following:

  • Correct number of parameters (inputFileName, Weights, Impacts, resultFileName).
  • Show the appropriate message for wrong inputs.
  • Handling of “File not Found” exception
  • The input file must contain three or more columns.
  • From 2nd to last columns must contain numeric values only (Handling of non-numeric values)
  • The number of weights, number of impacts and number of columns (from 2nd to last columns) must be the same.
  • Impacts must be either +ve or -ve.
  • Impacts and weights must be separated by ‘,’ (comma).

License

MIT Licence

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_aryansaini_102303666-1.0.0.tar.gz (4.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_aryansaini_102303666-1.0.0-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file topsis_aryansaini_102303666-1.0.0.tar.gz.

File metadata

File hashes

Hashes for topsis_aryansaini_102303666-1.0.0.tar.gz
Algorithm Hash digest
SHA256 62cfb20e6ae35ce7023b8465589a5b912f30bf7d3ee13771ef4375dc0d495be0
MD5 aefaabbebeea602280ec63b5c0c06a2c
BLAKE2b-256 87dfb2cd7b533e2a03a21b04ea7c59ea00d3ecac5e499a16442e16f7b2328c8b

See more details on using hashes here.

File details

Details for the file topsis_aryansaini_102303666-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_aryansaini_102303666-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b6b61e1d388ecdc819f3582df8ef73fb9c3d85840c1e9a5ab8b5d1e3e93c655e
MD5 12781738308c7f50faa3e11368674368
BLAKE2b-256 39c2a86f2e342063038b56a7017afd0d0687cbe851a6f751b72a0722a2631372

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