Skip to main content

pyrepo-mcda

The Python 3 library for Multi-Criteria Decision Analysis.

Installation

pip install pyrepo-mcda

Usage

pyrepo-mcda can be used to rank alternatives after providing their performance values in the two-dimensional decision matrix matrix with alternatives in rows and criteria in columns, and criteria weights weights and types types in vectors. All criteria weights must sum to 1. Criteria types are equal to 1 for profit criteria and -1 for cost criteria. The TOPSIS method returns a vector with preference values pref assigned to alternatives. To rank alternatives according to TOPSIS preference values, we have to sort them in descending order because, in the TOPSIS method, the best alternative has the highest preference value. The alternatives are ranked using the rank_preferences method provided in the additions module of the pyrepo-mcda package. Parameter reverse = True means that alternatives are sorted in descending order. Here is an example of using the TOPSIS method:

import numpy as np
from pyrepo_mcda.mcda_methods import TOPSIS
from pyrepo_mcda import distance_metrics as dists
from pyrepo_mcda import normalizations as norms
from pyrepo_mcda.additions import rank_preferences

matrix = np.array([[256, 8, 41, 1.6, 1.77, 7347.16],
[256, 8, 32, 1.0, 1.8, 6919.99],
[256, 8, 53, 1.6, 1.9, 8400],
[256, 8, 41, 1.0, 1.75, 6808.9],
[512, 8, 35, 1.6, 1.7, 8479.99],
[256, 4, 35, 1.6, 1.7, 7499.99]])

weights = np.array([0.405, 0.221, 0.134, 0.199, 0.007, 0.034])
types = np.array([1, 1, 1, 1, -1, -1])

topsis = TOPSIS(normalization_method=norms.vector_normalization, distance_metric=dists.euclidean)
pref = topsis(matrix, weights, types)
rank = rank_preferences(pref, reverse = True)
print(rank)

License

pyrepo-mcda was created by Aleksandra Bączkiewicz. It is licensed under the terms of the MIT license.

Documentation

Documentation of this library with instruction for installation and usage is provided here

Download files

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

Source Distribution

pyrepo_mcda-0.1.14.tar.gz (43.7 kB view details)

Uploaded Source

Built Distribution

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

pyrepo_mcda-0.1.14-py3-none-any.whl (50.5 kB view details)

Uploaded Python 3

File details

Details for the file pyrepo_mcda-0.1.14.tar.gz.

File metadata

  • Download URL: pyrepo_mcda-0.1.14.tar.gz
  • Upload date:
  • Size: 43.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.0

File hashes

Hashes for pyrepo_mcda-0.1.14.tar.gz
Algorithm Hash digest
SHA256 1c4efe37880dd8bcef4555705633b05d854355a47a7ecf5524487f78ca7f2dcf
MD5 a570893dcb7239159e68a029c45199d9
BLAKE2b-256 620207021857a6b886b115a4b61ef8b3e5913a69da30c91dcf6ee81a63f938b8

See more details on using hashes here.

File details

Details for the file pyrepo_mcda-0.1.14-py3-none-any.whl.

File metadata

  • Download URL: pyrepo_mcda-0.1.14-py3-none-any.whl
  • Upload date:
  • Size: 50.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.0

File hashes

Hashes for pyrepo_mcda-0.1.14-py3-none-any.whl
Algorithm Hash digest
SHA256 5aa533c78d87461644c4297e09beed64bdaf5ef34a10032abe0f6c2e867cad0e
MD5 aa408b2ef055424b37de904860c4576f
BLAKE2b-256 5d0544035e92aa6fa5b197cd8ddeb67325e7e392c80b21b09d4926020f60a4b1

See more details on using hashes here.

Release history Release notifications | RSS feed

0.1.15

2 files

This release

0.1.14 This release

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.12

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page