Skip to main content

A package implement TOPSIS from scratch.

Project description

TOPSIS-Harnoor-102303260

This package is a Python-based command-line utility that implements the Technique for Order of Preference by Similarity to Ideal Solution (TOPSIS). It helps users evaluate and rank multiple alternatives by comparing them across several quantitative criteria. By incorporating user-specified weights and preference directions, the tool calculates a performance score and assigns a final rank to each alternative.


Installation

The package can be installed easily using pip:

pip install topsis-harnoor-102303260

Usage Overview

The application is designed to be executed directly from the terminal. To run the analysis, you must provide:

  • an input dataset (CSV or Excel),
  • a list of weights,
  • a list of impacts, and
  • an output filename to store the results.

Command Syntax

topsis <InputFile> <Weights> <Impacts> <OutputFile>

Argument Explanation

  1. InputFile

    • Location of the dataset file (.csv or .xlsx).
    • The file must contain at least three columns.
    • The first column represents the alternatives (such as Product IDs or Names) and is not included in calculations.
    • All subsequent columns should contain numeric criterion values.
  2. Weights

    • A comma-separated sequence of numbers defining the importance of each criterion.
    • Example: "3,2,1,4"
  3. Impacts

    • A comma-separated list of symbols (+ or -) indicating preference direction:
      • + means higher values are better
      • - means lower values are better
  4. OutputFile

    • The name of the CSV file where the computed scores and rankings will be saved.

Example Walkthrough

Suppose we want to evaluate five smartphones based on four criteria: Price, Camera Quality, Battery Capacity, and Storage.


1. Input Dataset (phones.csv)

Phone Price Camera Battery Storage
P1 500 8 4500 128
P2 600 9 4800 256
P3 450 7 4200 64
P4 700 9 5000 256
P5 550 8 4700 128

Evaluation Criteria:

  • Price → Lower is better (-)
  • Camera Quality → Higher is better (+)
  • Battery Capacity → Higher is better (+)
  • Storage → Higher is better (+)

2. Running the Analysis

Execute the following command:

topsis phones.csv "2,3,2,1" "-,+,+,+" results.csv
  • Camera quality is given the highest priority.
  • Price is treated as a cost criterion.

3. Output File (results.csv)

The output contains the original data along with two additional columns: TOPSIS Score and Rank.

Phone Price Camera Battery Storage TOPSIS Score Rank
P1 500 8 4500 128 0.548 3
P2 600 9 4800 256 0.682 2
P3 450 7 4200 64 0.401 5
P4 700 9 5000 256 0.755 1
P5 550 8 4700 128 0.612 4

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_harnoor_102303260-0.1.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

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

topsis_harnoor_102303260-0.1.1-py3-none-any.whl (4.0 kB view details)

Uploaded Python 3

File details

Details for the file topsis_harnoor_102303260-0.1.1.tar.gz.

File metadata

File hashes

Hashes for topsis_harnoor_102303260-0.1.1.tar.gz
Algorithm Hash digest
SHA256 87db129d313b6aeb6158a68ac531dfcc5097ec0ce4a4eae8c9556772531cfd4d
MD5 ca86856d5ff74c51ee23937f77e08f44
BLAKE2b-256 8d359fefa1307d2cfb0a9f28bf7b0dfddc0513e7e0cad5b40b513bd0acfdee67

See more details on using hashes here.

File details

Details for the file topsis_harnoor_102303260-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_harnoor_102303260-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 80dbb9eeb22914f1092ab4576c7d5ddc73970c0c6c31865bd91e769a6dbf3979
MD5 014f077928047369326c7c7e7aa90cf8
BLAKE2b-256 0da8a5ed177840b18c41b34c7a3a667d7bfdcb1530fd0a517913468ece658592

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