Skip to content

Valdecy/pyRankMCDA

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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
    • Footrule Rank Aggregation
    • Fast Footrule Rank Aggregation
    • Kemeny-Young Method
    • Fast Kemeny-Young
    • Median Rank Aggregation
    • PageRank Algorithm
    • Plackett-Luce Model Aggregation
    • Reciprocal Rank Fusion
    • Schulze Method
  • Distance and Correlation Metrics:

    • Cayley Distance
    • Footrule Distance
    • Kendall Tau 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

  1. Install
pip install pyRankMCDA
  1. Basic Example
import numpy as np
from pyRankMCDA.algorithm 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)
  1. Running Multiple Methods
# Define the methods to run
methods = ['bd', 'cp', 'fky', 'md', 'pg']

# Run selected methods
df = ra.run_methods(methods)
  1. Visualization
# Plot heatmap of rankings
ra.plot_ranks_heatmap(df)

# Plot radar chart of rankings
ra.plot_ranks_radar(df)
  1. Computing Metrics
# Calculate distance and correlation metrics
d_matrix = ra.metrics(df)

# Plot metric comparisons
ra.metrics_plot(d_matrix)
  1. Try it in Colab:
  1. Others
  • 3MOAHP - Inconsistency Reduction Technique for AHP and Fuzzy-AHP Methods
  • 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
  • EC-PROMETHEE - A Committee Approach for Outranking Problems
  • MCDM Scheduler - A MCDM approach for Scheduling Problems

About

Rank Aggregation Methods for MCDA Problems

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages