Skip to main content

PROMETHEE I/II/Gamma/Sort MCDA methods

Project description

promethee

Python implementation of the PROMETHEE family of MCDA (Multi-Criteria Decision Analysis) methods, maintained by the SMG research group. Built on mcda-core.

Implements PROMETHEE I (partial ranking), PROMETHEE II (complete ranking), PROMETHEE Gamma, and PROMETHEE Sort, with all six standard preference functions.

Installation

pip install mcda-promethee

Python ≥ 3.9.

Quick start

import numpy as np
from promethee import PrometheeII, PerformanceTable, ParametersPromethee, build_preference_functions

# 4 countries evaluated on 2 indicators
table = PerformanceTable(
    values=np.array([
        [77.2, 0.887],
        [76.5, 0.832],
        [80.1, 0.919],
        [73.4, 0.798],
    ]),
    alternatives=["Country A", "Country B", "Country C", "Country D"],
    criteria=["life_expectancy", "education_index"],
    directions=[1, 1],  # maximise both
)

weights = np.array([0.5, 0.5])
prefs = build_preference_functions([
    ("v_shape_with_indifference", {"p": 5.0, "q": 1.0}),
    ("v_shape_with_indifference", {"p": 0.08, "q": 0.02}),
])

params = ParametersPromethee(weights=weights, preference_functions=prefs)
model = PrometheeII(performance_table=table, parameters=params)
model.fit()

print(model.net_flows)   # φ score per alternative
print(model.ranking)     # indices sorted best → worst

Parameters can also be loaded from a JSON file (see tests/data/epi_parameters.json for an example):

import json
from promethee import ParametersPromethee

with open("parameters.json") as f:
    params = ParametersPromethee.from_dict(json.load(f))

Preference functions

All six standard PROMETHEE preference functions are available:

kind string parameters description
"usual" Full preference for any positive difference
"u_shape" q Step at indifference threshold
"v_shape" p Linear up to preference threshold
"v_shape_with_indifference" q, p Linear between indifference and preference thresholds
"level" q, p Half preference in the intermediate zone
"gaussian" s Smooth Gaussian curve (inflection point s)
from promethee import build_preference_functions

prefs = build_preference_functions([
    ("usual", {}),
    ("v_shape_with_indifference", {"q": 2.0, "p": 8.0}),
    ("gaussian", {"s": 3.0}),
])

API reference

PrometheeII

Computes a complete ranking via net flows φ.

property description
net_flows φ score per alternative, shape (n,)
scores alias for net_flows
pairwise_preferences aggregated preference matrix π, shape (n, n)
monocriterion_net_flows mono-criterion net flows φ_k, shape (n, m)
ranking indices sorted best → worst
result() returns net_flows

All properties trigger fit() automatically if not already called.

ParametersPromethee

field type description
weights ndarray (m,) criterion weights (need not sum to 1)
preference_functions Sequence[PreferenceFunction] one per criterion

Constructors:

  • ParametersPromethee(weights, preference_functions) — direct
  • ParametersPromethee.from_dict(data) — from a parameter dictionary
  • ParametersPromethee.from_weights_and_criteria(weights, criteria_types, p, q) — shorthand using V-shape with indifference

Quality indicators

PrometheeII implements the ValuedPreferenceScoringModel protocol, giving access to quality indicators:

from promethee import r_squared, additive_transitivity_index

print(r_squared(model))                   # how well φ explains π
print(additive_transitivity_index(model)) # transitivity violations (0 = perfect)

Other algorithms

class description import path
PrometheeI Partial ranking via positive/negative flows promethee.algorithms.promethee1
PrometheeGamma Extends II with γ-based incomparability detection (Dejaegere & De Smet, 2023) promethee.algorithms.promethee_gamma

PrometheeGamma uses ParametersPrometheeGamma, which extends ParametersPromethee with three additional fields: Pf, Ti, Tj.

Ecosystem

Part of the modular MCDA Python ecosystem. See mcda-core for the full picture.

License

MIT — see LICENSE.

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

mcda_promethee-0.4.0.tar.gz (24.7 kB view details)

Uploaded Source

Built Distribution

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

mcda_promethee-0.4.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

Details for the file mcda_promethee-0.4.0.tar.gz.

File metadata

  • Download URL: mcda_promethee-0.4.0.tar.gz
  • Upload date:
  • Size: 24.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for mcda_promethee-0.4.0.tar.gz
Algorithm Hash digest
SHA256 48fcf881d297e95e2ea8103fb5284e369d1368ed3ac2f5228b999e70327f2d7d
MD5 fb83f76333d81fa500251cbbef0e2e0c
BLAKE2b-256 eb6430b27db5c844e7949698576ba8d704726679e572b089913c865fdd4bcac2

See more details on using hashes here.

File details

Details for the file mcda_promethee-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: mcda_promethee-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.20

File hashes

Hashes for mcda_promethee-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f80dcac3dadcca08665e22abc7365ff45a13b8e36ffb9329b09afc1df0c51666
MD5 b09c6c6e3285b8cea827e219d1c4a42b
BLAKE2b-256 911a98f6a2ee4d83568fbf412f3f2c53a42ea9eb57a406039a62e375f8f74d4d

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