Skip to main content

A TOPSIS implementation package for Multiple Criteria Decision Making

Project description

TOPSIS-Devansh-102203449 Description This package implements the Technique for Order of Preference by Similarity to Ideal Solution (TOPSIS) method for Multiple Criteria Decision Making (MCDM). TOPSIS is a method of compensatory aggregation that compares a set of alternatives based on their geometric distance from both the ideal best and ideal worst solutions. Installation Install the package using pip: bashCopypip install TOPSIS-Devansh-102203449 Usage Command Line Interface bashCopypython -m topsis_yourname Arguments:

InputDataFile: CSV file containing the decision matrix

First column: Object/Variable names 2nd to last columns: Numeric values only

Weights: Comma-separated weights (e.g., "1,1,1,2") Impacts: Comma-separated impacts, either + or - (e.g., "+,+,-,+") ResultFileName: Output CSV file name

Example: bashCopypython -m topsis_yourname input.csv "1,1,1,2" "+,+,-,+" output.csv Python Package Usage pythonCopyfrom topsis_yourname import topsis_score

Read your data into a pandas DataFrame

import pandas as pd df = pd.read_csv('input.csv')

Define weights and impacts

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

Calculate TOPSIS scores

result = topsis_score(df, weights, impacts) result.to_csv('output.csv', index=False) Input File Format

CSV file with 3 or more columns First column: Object/Variable names All other columns: Numeric values only

Example input.csv: CopyModel,Price,Storage,Camera,Battery M1,800,256,12,4000 M2,900,512,16,4500 M3,850,256,16,4200 Output Format The output file will contain all columns from the input file plus two additional columns:

Topsis Score: The calculated TOPSIS score Rank: The rank based on the TOPSIS score

Error Handling The package handles the following errors:

Incorrect number of command-line parameters File not found Invalid file format Non-numeric values in columns Unequal number of weights, impacts, and columns Invalid impact symbols (must be + or -)

License This project is licensed under the MIT License - see the LICENSE file for details. Author [Devansh Dhir] Support For any questions or issues, please open an issue on the GitHub repository.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Topsis-Devansh-102203449-0.1.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

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

Topsis_Devansh_102203449-0.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file Topsis-Devansh-102203449-0.1.tar.gz.

File metadata

  • Download URL: Topsis-Devansh-102203449-0.1.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.10.0

File hashes

Hashes for Topsis-Devansh-102203449-0.1.tar.gz
Algorithm Hash digest
SHA256 3f423c74f115c936da2b46c59a630b8be2c8981b8965260216a14abbbbfdd61e
MD5 a5d0c4812a56782803e3134bf4d56dce
BLAKE2b-256 2beb95bca21a966e31387f807746f8d028ac901d0c52b4a61e3f1b2be88b3455

See more details on using hashes here.

File details

Details for the file Topsis_Devansh_102203449-0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for Topsis_Devansh_102203449-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0d88506fe45df0754fa9f3b83bb04112f3bef4f3121635716a3fcd08748240c1
MD5 94d8776fb2ddc92b9ffbb8b9fb880f2e
BLAKE2b-256 cf199fb92d30750f29106c15d59aada4755d5d8a6df3f166f9e4325fed99722d

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