Skip to main content

A Python implementation of TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) for multi-criteria decision analysis

Project description

TOPSIS Package

A Python implementation of TOPSIS (Technique for Order Preference by Similarity to Ideal Solution) - a Multi-Criteria Decision Making (MCDM) method for ranking alternatives based on multiple criteria.

Overview

TOPSIS helps you select the best alternative from multiple options by comparing them across various criteria. It considers both benefit criteria (higher is better) and cost criteria (lower is better).

Installation

Prerequisites

  • Python 3.4 or higher
  • pandas >= 0.23.0
  • numpy >= 1.14.0

Install via pip

pip install TOPSIS-KRISH-MAHAJAN

Install from source

git clone https://github.com/krishmahajan7/TOPSIS-KRSH-MAHAJAN-102303139.git
cd TOPSIS-KRSH-MAHAJAN-102303139
pip install -r requirements.txt
python setup.py install

Usage

Basic Example

from TOPSIS_KRISH_MAHAJAN import TOPSIS

topsis = TOPSIS()

topsis.topsis(
    input_file='data.csv',
    weights='1,2,1,3',
    impacts='+,+,-,+',
    result_file='results.csv'
)

Parameters

  • input_file: Path to input CSV file
  • weights: Comma-separated weights for each criterion (string or list)
  • impacts: '+' for benefit criteria, '-' for cost criteria (string or list)
  • result_file: Path where output CSV will be saved

Input File Format

Alternative,Criterion1,Criterion2,Criterion3
Option_A,5,3,6
Option_B,6,4,5
Option_C,7,2,7
  • First column: Alternative names (non-numeric)
  • Other columns: Numeric criterion values
  • Minimum 3 columns required (1 alternative + 2 criteria)

Output File Format

Alternative,Criterion1,Criterion2,Criterion3,Topsis_Score,Rank
Option_A,5,3,6,0.564,2
Option_B,6,4,5,0.628,1
Option_C,7,2,7,0.542,3
  • Topsis_Score: Similarity to ideal solution (0-1, higher is better)
  • Rank: Position in the ranking (1 = best)

Error Handling

The package validates:

  • Input file exists
  • At least 3 columns in CSV
  • Numeric values in criteria columns
  • Correct number of weights
  • Correct number of impacts

Supported Python Versions

  • Python 3.4, 3.5, 3.6, 3.7, 3.8

License

MIT License - See LICENSE.txt for details

Author

Krish Mahajan (Roll No: 102303139)

Repository

TOPSIS-KRSH-MAHAJAN-102303139

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_krish_mahajan-0.1.tar.gz (3.7 kB view details)

Uploaded Source

Built Distribution

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

topsis_krish_mahajan-0.1-py3-none-any.whl (3.8 kB view details)

Uploaded Python 3

File details

Details for the file topsis_krish_mahajan-0.1.tar.gz.

File metadata

  • Download URL: topsis_krish_mahajan-0.1.tar.gz
  • Upload date:
  • Size: 3.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.3

File hashes

Hashes for topsis_krish_mahajan-0.1.tar.gz
Algorithm Hash digest
SHA256 b0ffcfced0239cf280a6a9b999a5442d1a13d9c84271b60885ea2e2d2e2d29e0
MD5 9e818a4a2514cd25bba3bb23bca18d6d
BLAKE2b-256 7e129a67e1ed13379feff283ab9ed8ff2d9aa48c413142f510b9fccff1af9d6f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for topsis_krish_mahajan-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7cd3cbe447e9093e0cc690806910bb632dd609d89750db916bc4f912c6d50665
MD5 606d654fb1d4cbe2a705918343207891
BLAKE2b-256 ffc03ff575e06e52325bc9d7eb9b31a19ac8478e99c19aff3e1fc6c81b80a8d8

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