Coder Social home page Coder Social logo

whlcode-2001 / pydecision Goto Github PK

View Code? Open in Web Editor NEW

This project forked from valdecy/pydecision

0.0 0.0 0.0 206 KB

A python MCDA Library - AHP; Fuzzy AHP; ARAS; Borda; BWM; CODAS; COPRAS; CRITIC; DEMATEL; Fuzzy DEMATEL; EDAS; Fuzzy EDAS; ELECTRE (I, I_s, I_v, II, III, IV, Tri-B); GRA; IDOCRIW; MABAC; MOORA; MOOSRA; MULTIMOORA; PROMETHEE (I, II, III, IV, V, VI, Gaia); SAW; SMART; TOPSIS; Fuzzy TOPSIS; VIKOR; Fuzzy VIKOR; WINGS; WSM; WPM; WASPAS

License: Other

Python 100.00%

pydecision's Introduction

pyDecision

Introduction

A python library with the following MCDA methods: AHP (Analytic Hierarchy Process); Fuzzy AHP; ARAS (Additive Ratio ASsessment); Borda; BWM (Best-Worst Method); CODAS (Combinative Distance-based Assessment); COPRAS (Complex PRoportional Assessment); CRITIC (CRiteria Importance Through Intercriteria Correlation); DEMATEL (DEcision MAking Trial and Evaluation Laboratory); Fuzzy DEMATEL; EDAS (Evaluation based on Distance from Average Solution); Fuzzy EDAS; ELECTRE (I, I_s, I_v, II, III, IV, Tri-B); GRA (Grey Relational Analysis); IDOCRIW (Integrated Determination of Objective CRIteria Weights); MABAC (Multi-Attributive Border Approximation area Comparison); MOORA (Multi-Objective Optimization on the basis of Ratio Analysis); MOOSRA (Multi-Objective Optimisation on the Basis of Simple Ratio Analysis); MULTIMOORA (Multi-Objective Optimization on the basis of Ratio Analisys Multiplicative Form); PROMETHEE (I, II, III, IV, V, VI, Gaia); SAW (Simple Additive Weighting); SMART (Simple Multi-Attribute Rating Technique); TOPSIS (Technique for Order of Preference by Similarity to Ideal Solution); Fuzzy TOPSIS; VIKOR (VIseKriterijumska Optimizacija I Kompromisno Resenje); Fuzzy VIKOR; WINGS (Weighted Influence Non-linear Gauge System); WSM (Weighted Sum Model); WPM (Weighted Product Model); WASPAS (Weighted Aggregates Sum Product Assessment).

Usage

  1. Install
pip install pyDecision
  1. Import
# Import AHP
from pyDecision.algorithm import ahp_method

# Parameters
weight_derivation = 'geometric' # 'mean' or 'geometric'

# Dataset
dataset = np.array([
  #g1     g2     g3     g4     g5     g6     g7                  
  [1  ,   1/3,   1/5,   1  ,   1/4,   1/2,   3  ],   #g1
  [3  ,   1  ,   1/2,   2  ,   1/3,   3  ,   3  ],   #g2
  [5  ,   2  ,   1  ,   4  ,   5  ,   6  ,   5  ],   #g3
  [1  ,   1/2,   1/4,   1  ,   1/4,   1  ,   2  ],   #g4
  [4  ,   3  ,   1/5,   4  ,   1  ,   3  ,   2  ],   #g5
  [2  ,   1/3,   1/6,   1  ,   1/3,   1  ,   1/3],   #g6
  [1/3,   1/3,   1/5,   1/2,   1/2,   3  ,   1  ]    #g7
])

# Call AHP Function
weights, rc = ahp_method(dataset, wd = weight_derivation)

# Weigths
for i in range(0, weights.shape[0]):
  print('w(g'+str(i+1)+'): ', round(weights[i], 3))
  
# Consistency Ratio
print('RC: ' + str(round(rc, 2)))
if (rc > 0.10):
  print('The solution is inconsistent, the pairwise comparisons must be reviewed')
else:
  print('The solution is consistent')
  1. Try it in Colab:
  1. Advanced MCDA Methods:
  • 3MOAHP - Inconsistency Reduction Technique for AHP and Fuzzy-AHP Methods
  • 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.