Skip to main content

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

Project description

Topsis-Vani-102303078

PyPI version Python Version License: MIT

A Python package implementing TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) for multi-criteria decision making.

Author: Vani Goyal
Roll Number: 102303078
Email: vgoyal_be23@thapar.edu

What is TOPSIS?

TOPSIS is a multi-criteria decision analysis method that identifies the best alternative by calculating the geometric distance from the ideal solution and the negative-ideal solution.

Installation

pip install Topsis-Vani-102303078

Usage

Command Line Interface

topsis <InputDataFile> <Weights> <Impacts> <OutputFileName>

Example

topsis test_data/data.csv "1,1,1,2" "+,+,-,+" test_data/result.csv

Python Module

from topsis_vani_102303078 import topsis

topsis('input.csv', '1,1,1,2', '+,+,-,+', 'output.csv')

Input Format

CSV file with:

  • Column 1: Alternative names/IDs
  • Columns 2-N: Numeric criteria values

Example:

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

Parameters

Weights

Comma-separated positive numbers (e.g., "1,1,1,2")

Impacts

Comma-separated + or - signs:

  • + : Higher values are better (benefit criterion)
  • - : Lower values are better (cost criterion)

Example: "+,+,-,+" means maximize P1, P2, P4 and minimize P3

Output

CSV file with original data plus:

  • Topsis Score: Performance score (0-100, higher is better)
  • Rank: Final ranking (1 is best)

Algorithm Steps

  1. Normalization: Vector normalization of decision matrix
  2. Weighted Matrix: Apply criterion weights
  3. Ideal Solutions: Identify best and worst solutions
  4. Distance Calculation: Euclidean distances from ideals
  5. TOPSIS Score: Closeness coefficient calculation
  6. Ranking: Sort by TOPSIS score

Requirements

  • Python >= 3.7
  • pandas >= 1.0.0
  • numpy >= 1.18.0

License

MIT License - see LICENSE file

Links

Author

Vani Goyal
Roll Number: 102303078
Thapar Institute of Engineering & Technology
Email: vgoyal_be23@thapar.edu

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_vani_102303078-1.0.1.tar.gz (5.2 kB view details)

Uploaded Source

Built Distribution

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

topsis_vani_102303078-1.0.1-py3-none-any.whl (5.8 kB view details)

Uploaded Python 3

File details

Details for the file topsis_vani_102303078-1.0.1.tar.gz.

File metadata

  • Download URL: topsis_vani_102303078-1.0.1.tar.gz
  • Upload date:
  • Size: 5.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for topsis_vani_102303078-1.0.1.tar.gz
Algorithm Hash digest
SHA256 483376510549327f14b9abb79c64af367aca7bfb3ce7fe55ff2e1a1b8ff559de
MD5 7f65c2b7185ed5f6d1c529e68278bdc9
BLAKE2b-256 327773d3771f2f015ec26b37c7a8533a2a369b8db8dbe817cec93ba5cef0977d

See more details on using hashes here.

File details

Details for the file topsis_vani_102303078-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_vani_102303078-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 61d8beef421576931839371d3703e3f9b9e4fd50322eca736491806d2836632c
MD5 54e9286fb67f81992260180d4b83ff91
BLAKE2b-256 2365bf0c0b3f976efd5dce444fc9bc2fc8aa0086b5cc5bcfe8f585829c02fd29

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