Skip to main content

Technique for Order of Preference by Similarity to Ideal Solution (TOPSIS) CHING-LAI Hwang and Yoon introduced TOPSIS in 1981 in their Multiple Criteria Decision Making (MCDM) and Multiple Criteria Decision Analysis (MCDA) methods

Project description

TOPSIS Python

IMPORTANT: This implementation was originally developed by Intelizer. Jules was used to make it a pip-installable package.

This repository provides a Python implementation of the Technique for Order of Preference by Similarity to Ideal Solution (TOPSIS), a method for multiple-criteria decision analysis.

Installation

You can install this package using pip:

pip install topsis-hamedbaziyad

Usage

Here is a simple example of how to use the topsis package:

import pandas as pd
from topsis_hamedbaziyad import TOPSIS

# Create a sample decision matrix
data = {
    'Alternatives': ['A1', 'A2', 'A3', 'A4'],
    'C1': [10, 12, 15, 8],
    'C2': [8, 9, 11, 10],
    'C3': [7, 10, 8, 9]
}
decision_matrix = pd.DataFrame(data).set_index('Alternatives')

# Define the weights and attribute types
weights = [0.4, 0.3, 0.3]
attribute_types = [1, 1, 0]

# Run the TOPSIS algorithm
topsis_result = TOPSIS(decision_matrix, weights, attribute_types)
topsis_result = pd.DataFrame(topsis_result).sort_values(by=0, ascending=False)
topsis_result.columns = ["Performance Score"]

# Display the results
print(topsis_result)

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_hamedbaziyad-0.0.2.tar.gz (7.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_hamedbaziyad-0.0.2-py3-none-any.whl (8.1 kB view details)

Uploaded Python 3

File details

Details for the file topsis_hamedbaziyad-0.0.2.tar.gz.

File metadata

  • Download URL: topsis_hamedbaziyad-0.0.2.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.0

File hashes

Hashes for topsis_hamedbaziyad-0.0.2.tar.gz
Algorithm Hash digest
SHA256 e6efd62c75939cd91e3477ec4ae11dbdc059fdd5a3275c8f6c55d0ec6da1c6b0
MD5 54d2a358774bd679ab2b3775270d2a86
BLAKE2b-256 bdcccf5025ac72c83b17fa8afcc0311ffde740a9b8cbef581da9b54f6a24be2d

See more details on using hashes here.

File details

Details for the file topsis_hamedbaziyad-0.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for topsis_hamedbaziyad-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 216f3dc0a6c0ceaa829fce323cb0ac7b88468bbc9425d5b3ca2eb137139302d1
MD5 612dccf3ce3e721ea52d437f6a7003da
BLAKE2b-256 f4820e3c50edf5398a299e15e8ba7f49379952f93fd8439753256d259faaac71

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