Skip to main content

TOPSIS

Project description

TOPSIS

Technique for Order of Preference by Similarity to Ideal Solution

Citation

If you use this package, please refer cite.

Installation

INSTALLING VIA PIP

inbuilt Python package management system, pip.

You can can install, update, or delete the topsis2.

install

pip install topsis2

update

pip install --upgrade topsis2

uninstall

pip uninstall topsis2

Usage

Using this TOPSIS implementation is straightforward as importing it and writing only two lines. The important thing is the decision matrix in the type of pandas data frame.

The decision matrix would be some data frame as the following example.

DM

After building your decision matrix, you need to define the criteria types (benefit or cost). To have the type, you can define a list as the impact. For instance, we assume that the first two criteria are benefit criteria and the last is the cost.

impact = ['+', '+', '-']

The ultimate step is assigning the weight array.

weight = np.array([0.1, 0.7, 0.2])

After having the three parameters, the model produces the ranking matrix.

import numpy as np

import pandas as pd

from topsis import topsis



array = np.random.randint(10, size=(5, 3))



decision_matrix = pd.DataFrame(array, columns=[

                               'criterion_' + str(i) for i in range(1, 4)],

                               index=['option_'+str(i) for i in range(1, 6)])



impact = ['+', '+', '-']

weight = np.array([0.1, 0.7, 0.2])



tp = topsis(decision_matrix=decision_matrix,

            weight=weight, impact=impact)

tp.rank()

ranking

Requirements

This package takes advantage of the following libraries, which had already imported to the TOPSIS package:

  • scipy

  • numpy

  • pandas

Keywords

TOPSIS, MCDM, MADM

Version

0.0.2

Updated

2022-05-19

Date-released

2022-05-18

More about TOPSIS

To read more about the TOPSIS method and the logic behind the model, please refer here.

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

topsis2-0.0.2.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

topsis2-0.0.2-py3-none-any.whl (11.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: topsis2-0.0.2.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.10

File hashes

Hashes for topsis2-0.0.2.tar.gz
Algorithm Hash digest
SHA256 bbc366a111c228fdf05e5a9f2268f1af7261387c70cd45f2d046c0167ba6768b
MD5 2aeb2bbc615dc0ca36f8fe48d0f7017f
BLAKE2b-256 03fc45099cc4cb7fa01d7f29befb47b12604cb4e0e76e66e7f9abdbaa6763e63

See more details on using hashes here.

File details

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

File metadata

  • Download URL: topsis2-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 11.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.9.10

File hashes

Hashes for topsis2-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 13907a9eb4b0be1073299c657bf655baa0ce63c7e07e91c8a4f860dd63390762
MD5 fd4bc7542fe257f2b7f7f54db36b6538
BLAKE2b-256 27c47eccca07a941724b2212d0197ae591c9621a716571780e6675f65e2e8926

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page