A Rank Aggegation Library for MCDA problems
Project description
pyRankMCDA
Introduction
pyRankMCDA is a Python library designed for rank aggregation in multi-criteria decision analysis (MCDA). It provides implementations of classical and modern rank aggregation methods, allowing users to combine multiple rankings into a single consensus ranking. This is particularly useful in fields like decision science, information retrieval, and any domain where synthesizing different ordered lists is necessary.
Features
-
Multiple Rank Aggregation Methods:
- Borda Method
- Copeland Method
- Fast Kemeny-Young
- Fast Footrule Rank Aggregation
- Footrule Rank Aggregation
- Kemeny-Young Method
- Median Rank Aggregation
- PageRank Algorithm
- Plackett-Luce Model Aggregation
- Reciprocal Rank Fusion (RRF)
- Schulze Method
-
Distance and Correlation Metrics:
- Cayley Distance
- Footrule Distance
- Kendall Tau Correlation
- Spearman Rank Correlation
-
Visualization Tools:
- Heatmaps of rankings
- Radar charts comparing rankings from different methods
- Multidimensional Scaling (MDS) plots for visualizing distances between ranking methods
Usage
- Install
pip install pyRankMCDA
- Basic Example
import numpy as np
from pyRankMCDA import rank_aggregation
# Example rankings from different methods
ranks = np.array([
[1, 2, 3],
[2, 1, 3],
[3, 2, 1]
])
# Initialize rank aggregation object
ra = rank_aggregation(ranks)
# Run Borda method
borda_rank = ra.borda_method(verbose = True)
- Running Multiple Methods
# Define the methods to run
methods = ['bd', 'cp', 'fky', 'md', 'pg']
# Run selected methods
df = ra.run_methods(methods)
- Visualization
# Plot heatmap of rankings
ra.plot_ranks_heatmap(df)
# Plot radar chart of rankings
ra.plot_ranks_radar(df)
- Computing Metrics
# Calculate distance and correlation metrics
d_matrix = ra.metrics(df)
# Plot metric comparisons
ra.metrics_plot(d_matrix)
- Try it in Colab:
- Example: ( Colab Demo )
- Others
- pyDecision - A library for many MCDA methods
- pyMissingAHP - A Method to Infer AHP Missing Pairwise Comparisons
- ELECTRE-Tree - Algorithm to infer the ELECTRE Tri-B method parameters
- Ranking-Trees - Algorithm to infer the ELECTRE II, III, IV and PROMETHEE I, II, III, IV method parameters
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pyRankMCDA-2.1.2.tar.gz
.
File metadata
- Download URL: pyRankMCDA-2.1.2.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1893994dc15e9a308fbc2fa62e55885fb56fa63071cd633477c9bc57fb6ecde3 |
|
MD5 | 6f85fdd10d5bd414b3c578acd57f8530 |
|
BLAKE2b-256 | d2aaaffccffcec8ac9a07b478a140f4b31bdca965d9d3897e646060229813dc9 |
File details
Details for the file pyRankMCDA-2.1.2-py3-none-any.whl
.
File metadata
- Download URL: pyRankMCDA-2.1.2-py3-none-any.whl
- Upload date:
- Size: 10.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.10.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3c698bca3e50631fd6dcc831faaf343d28cee2d731a9a047be119dea686fbca4 |
|
MD5 | 94841f583a0babf026cc085d7427cb26 |
|
BLAKE2b-256 | 1fec52fcf32df2b93e83e5df72285946726129ff3fa350165af726f2d9195208 |