Skip to main content

pyrepo-mcda

GitHub PyPI Documentation License DOI

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

Metadata

Release files for pyrepo-mcda 0.1.16

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pyrepo-mcda 0.1.16
File Size Uploaded Provenance Actions
pyrepo_mcda-0.1.16.tar.gz 44.2 kB Without provenance Details for pyrepo_mcda-0.1.16.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for pyrepo-mcda 0.1.16
File Interpreter ABI Platform Actions
pyrepo_mcda-0.1.16-py3-none-any.whl Python 3 none any Details for pyrepo_mcda-0.1.16-py3-none-any.whl

Total release size: 94.9 kB

Release files / pyrepo_mcda-0.1.16.tar.gz

Download URL pyrepo_mcda-0.1.16.tar.gz
Size 44.2 kB
Tags Source
SHA-256 checksum
How to use checksums
82775b314ea327c295e31df8c40f5b55b45d085bde208a2a7cb27414855be715
BLAKE2b-256 checksum
How to use checksums
3fac868b1f5667fb4be8d4d1f809cb416d754287cde84a6020ae39afa8860c12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Release files / pyrepo_mcda-0.1.16-py3-none-any.whl

Download URL pyrepo_mcda-0.1.16-py3-none-any.whl
Size 50.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
97f717b0cd36d1cddf87bc8deaf43eda8e4b21b02792a4dba13d5a336a45bbfd
BLAKE2b-256 checksum
How to use checksums
02ac56ec9cc789aa458463eeceaa062ccec66cbcc9190a0e8160e0038ca7e302
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.0

Security for pyrepo-mcda 0.1.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

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