Skip to main content

pyDematel a python-based tool implementing the Dematel and fuzzy Dematel methods for improved decision making

Project description

pyDEMATEL

License: BSD

Graphical interface of pyDEMATEL

Table of Contents

Overview

The pyDEMATEL tool is designed to implement and facilitate the use of the DEMATEL and Fuzzy DEMATEL methods. The tool comprises three distinct classes: DEMATELSolver, FuzzyDEMATELSolver, and DEMATELWindow.

  • DEMATELSolver: Implements the standard DEMATEL method.
  • FuzzyDEMATELSolver: Implements the Fuzzy DEMATEL method.
  • DEMATELWindow: Provides a graphical interface for users to interact with the tool.

This separation is designed to offer two ways of using the tool:

  1. Graphical Interface Mode: Allows decision-makers to use the tool directly via its graphical interface provided by the DEMATELWindow class.
  2. Package Integration Mode: Allows developers to directly integrate the DEMATELSolver or FuzzyDEMATELSolver classes into their own applications, without needing the graphical interface.

License

This project is licensed under the BSD License - see the LICENSE file for details.

Features

  • Feature 1: Data Acquisition Methods: Acquires numbers and names of experts and factors and gathers evaluation matrix values from each expert.
  • Feature 2: Matrix Generation Steps: Computes the "direct-influence matrix Z", generates the "normalized direct-influence matrix X", creates the "total-influence matrix T" and produces an "influential Relation Map IRM".
  • Feature 3: Output Presentation Methods: Presents outputs in various formats, including graphical representations and provides options to generate Excel documents.
  • Feature 4: Integration and Flexibility: Designed for integration into Python-based programs and Implements the DEMATEL method comprehensively, ensuring accuracy and completeness.

Installation

Prerequisites

Before you begin, ensure that Python and pip are installed and updated on your system.

Steps to Install

To install the pyDEMATEL package, use the following command:

pip install pyDEMATEL

The following libraries are installed automatically with pyDEMATEL:

Usage

Use the following command to execute the graphical interface of the pyDEMATEL software:

pydematel

The steps to follow are : :

  • Step 1: Enter the number of experts and the number of factors.
  • Step 2: Provide the names of experts and factors.
  • Step 3: Choose the solving method: either DEMATEL or FuzzyDEMATEL
  • Step 4: Enter the evaluation matrix for each expert.
  • Step 5: Generate the results.

Example

Here is an example demonstrating how to use the FuzzyDEMATELSolver package, which implements the FuzzyDEMATEL method:

from pyDEMATEL.FuzzyDEMATELSolver import FuzzyDEMATELSolver
import numpy as np

# Inputs: experts and factors
expert = "bob"
factors =  ["A1", 
            "A2", 
            "A3", 
            "A4", 
            "A5", 
            "A6", 
            "A7", 
            "A8",
            "A9",
            "A10",           
            "A11", 
            "A12", 
            "A13", 
            "A14", 
            "A15", 
            "A16", 
            "A17", 
            "A18"] 
    
# Linguistic evaluation matrix of marine experts’ consensus in other words evaluation matrix for each expert (source  https://www.sciencedirect.com/science/article/pii/S0950423015300498)
evaluationMatrix=[
[(0, 0, 0.25),(0, 0, 0.25),(0.5, 0.75, 1),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0, 0.25),(0, 0.25, 0.5),(0.5, 0.75, 1),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0, 0.25),(0.25, 0.5, 0.75),(0, 0, 0.25),(0, 0.25, 0.5),(0.5, 0.75, 1)],
[(0.5, 0.75, 1),(0, 0, 0.25),(0.5, 0.75, 1),(0.25, 0.5, 0.75),(0, 0, 0.25),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5),(0.75, 1, 1),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0, 0.25, 0.5),(0.5, 0.75, 1)],
[(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0, 0.25),(0.5, 0.75, 1),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0, 0.25),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0, 0.25),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0.5, 0.75, 1),(0, 0, 0.25),(0.25, 0.5, 0.75),(0.25, 0.5, 0.75)],
[(0.5, 0.75, 1),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0, 0, 0.25),(0.25, 0.5, 0.75),(0.5, 0.75, 1),(0.75, 1, 1),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0.5, 0.75, 1),(0.25, 0.5, 0.75),(0.75, 1, 1),(0.5, 0.75, 1),(0, 0.25, 0.5),(0.5, 0.75, 1),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5)],
[(0, 0.25, 0.5),(0, 0.25, 0.5),(0.5, 0.75, 1),(0.25, 0.5, 0.75),(0, 0, 0.25),(0.5, 0.75, 1),(0.5, 0.75, 1),(0, 0, 0.25),(0, 0.25, 0.5),(0, 0.25, 0.5),(0.75, 1, 1),(0.5, 0.75, 1),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0, 0.25),(0.5, 0.75, 1)],
[(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0, 0.25),(0.25, 0.5, 0.75),(0, 0, 0.25),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0.25, 0.5, 0.75),(0, 0, 0.25),(0, 0.25, 0.5),(0, 0.25, 0.5),(0.75, 1, 1)],
[(0, 0, 0.25),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0.5, 0.75, 1),(0.25, 0.5, 0.75),(0.25, 0.5, 0.75),(0, 0, 0.25),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0.25, 0.5, 0.75)],
[(0, 0, 0.25),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0, 0.25),(0, 0, 0.25),(0, 0, 0.25),(0.5, 0.75, 1),(0.5, 0.75, 1),(0, 0, 0.25),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0, 0.25)],
[(0, 0, 0.25),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0, 0.25),(0, 0, 0.25),(0.5, 0.75, 1),(0, 0, 0.25),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0, 0.25),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0, 0.25),(0.25, 0.5, 0.75),(0, 0, 0.25)],
[(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0, 0.25),(0.5, 0.75, 1),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0.75, 1, 1),(0, 0, 0.25),(0, 0.25, 0.5),(0.5, 0.75, 1),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0.5, 0.75, 1)],
[(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0.5, 0.75, 1),(0.75, 1, 1),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0.5, 0.75, 1),(0, 0, 0.25),(0, 0.25, 0.5),(0.5, 0.75, 1),(0, 0, 0.25),(0.75, 1, 1),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5),(0.5, 0.75, 1)],
[(0.25, 0.5, 0.75),(0.5, 0.75, 1),(0.75, 1, 1),(0.5, 0.75, 1),(0, 0, 0.25),(0, 0.25, 0.5),(0.75, 1, 1),(0, 0, 0.25),(0, 0.25, 0.5),(0.5, 0.75, 1),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0, 0.25),(0, 0.25, 0.5),(0.5, 0.75, 1),(0, 0, 0.25),(0, 0, 0.25),(0.5, 0.75, 1)],
[(0.5, 0.75, 1),(0.25, 0.5, 0.75),(0.75, 1, 1),(0.25, 0.5, 0.75),(0.75, 1, 1),(0, 0.25, 0.5),(0.5, 0.75, 1),(0, 0, 0.25),(0, 0, 0.25),(0, 0.25, 0.5),(0.5, 0.75, 1),(0.5, 0.75, 1),(0, 0, 0.25),(0.5, 0.75, 1),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5),(0, 0.25, 0.5)],
[(0, 0.25, 0.5),(0, 0.25, 0.5),(0.5, 0.75, 1),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0, 0.25),(0, 0, 0.25),(0, 0, 0.25),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0, 0.25),(0, 0, 0.25),(0, 0, 0.25),(0, 0, 0.25),(0.5, 0.75, 1)],
[(0.25, 0.5, 0.75),(0.25, 0.5, 0.75),(0.5, 0.75, 1),(0.75, 1, 1),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0.5, 0.75, 1),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0.5, 0.75, 1),(0.5, 0.75, 1),(0, 0, 0.25),(0.75, 1, 1),(0.25, 0.5, 0.75),(0.5, 0.75, 1)],
[(0, 0.25, 0.5),(0.75, 1, 1),(0.5, 0.75, 1),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0, 0.25),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0.25, 0.5, 0.75),(0, 0, 0.25),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0, 0.25),(0.5, 0.75, 1),(0.75, 1, 1)],
[(0, 0, 0.25),(0.5, 0.75, 1),(0.75, 1, 1),(0.5, 0.75, 1),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0.25, 0.5),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0, 0, 0.25),(0.25, 0.5, 0.75)],
[(0, 0.25, 0.5),(0.5, 0.75, 1),(0.75, 1, 1),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0, 0.25, 0.5),(0, 0, 0.25),(0, 0, 0.25),(0, 0.25, 0.5),(0.25, 0.5, 0.75),(0.5, 0.75, 1),(0.25, 0.5, 0.75),(0, 0.25, 0.5),(0, 0, 0.25),(0.25, 0.5, 0.75),(0.5, 0.75, 1),(0, 0.25, 0.5),(0, 0, 0.25)]
]           

matrices = np.array([np.array(evaluationMatrix, dtype=object)])

# Creating an instance of FuzzyDEMATELSolver
solver = FuzzyDEMATELSolver()
solver.setMatrix(matrices)
print('********* expert s individual direct influence matrices *********')
print(solver.getMatrix())
solver.addExpert(expert)
solver.setFactors(factors)
solver.setNumberOfExperts(1)
solver.setNumberOfFactors(18)
print('********* List of experts *********')
print(solver.getExperts())
print('********* List of Factors *********')
print(solver.getFactors())

# Executing the steps of the FuzzyDEMATEL method
solver.step1()
print('********* Direct Influence Fuzzy Matrix *********')
print(solver.getFuzzyDirectInfluenceMatrix())
solver.step2()
print('********* Normalized Direct Influence Fuzzy Matrix *********')
print(solver.getFuzzyNormalizedDirectInfluenceMatrix())
solver.step3()
print('********* Total Influence Fuzzy Matrix *********')
print(solver.getFuzzyTotalInfluenceMatrix())
solver.step4()
print('********* Relation *********')
print(solver.getRalation())
print('********* Prominence *********')
print(solver.getProminence())

# Generating the graph
solver.drawCurve()

# Generating excel file
solver.savexl(input("Please enter the destination path for the Excel file:"))

Here is an example demonstrating how to use the DEMATELSolver package, which implements the Classical DEMATEL method:

from pyDEMATEL.DEMATELSolver import DEMATELSolver
import numpy as np

# Inputs: experts and factors
expert = "bob"
factors = [ "A1", 
            "A2", 
            "A3", 
            "A4", 
            "A5", 
            "A6", 
            "A7", 
            "A8"]
    
# Average matrix in other words evaluation matrix for each expert (source  https://imisc.figshare.com/articles/journal_contribution/paper-codal-etal_pdf/7325816/3)
matrices= [np.array([[0.00, 1.11, 1.01, 1.41, 1.66, 0.50, 1.60, 2.00],                   
                      [1.43, 0.00, 2.22, 2.00, 2.40, 1.20, 1.66, 1.33], 
                      [0.82, 1.00, 0.00, 2.05, 2.44, 1.65, 2.65, 1.88], 
                      [1.92, 0.80, 1.82, 0.00, 2.75, 3.50, 3.33, 3.10], 
                      [2.20, 3.11, 1.25, 0.75, 0.00, 2.25, 2.66, 1.75], 
                      [1.01, 1.31, 1.45, 1.20, 1.44, 0.00, 0.75, 3.00], 
                      [3.50, 3.20, 2.95, 3.33, 2.88, 1.85, 0.00, 1.40], 
                      [0.50, 1.25, 1.40, 3.66, 1.00, 2.00, 3.33, 0.00]])]


# Creating an instance of DEMATELSolver
solver = DEMATELSolver()
solver.setMatrix(matrices)
print('********* expert s individual direct influence matrices *********')
print(solver.getMatrix())
solver.addExpert(expert)
solver.setFactors(factors)
solver.setNumberOfExperts(1)
solver.setNumberOfFactors(8)
print('********* List of experts *********')
print(solver.getExperts())
print('********* List of Factors *********')
print(solver.getFactors())

# Executing the steps of the DEMATEL method
solver.step1()
print('********* Direct Influence Matrix *********')
print(solver.getDirectInfluenceMatrix())
solver.step2()
print('********* Normalized Direct Influence Matrix *********')
print(solver.getNormalizedDirectInfluenceMatrix())
solver.step3()
print('********* Total Influence Matrix *********')
print(solver.getTotalInfluenceMatrix())
solver.step4()
print('********* Relation *********')
print(solver.getRalation())
print('********* Prominence *********')
print(solver.getProminence())

# Generating the graph
solver.drawCurve()

# Generating excel file
solver.savexl(input("Please enter the destination path for the Excel file:"))

Authors

  • Abderrahman Chekry1
  • Jamal Bakkas1
  • Mohamed Hanine2
  • Elizabeth Caro Montero3,4,5
  • Mirtha Silvana Garat de Marin3,7,8
  • Imran Ashraf8
    1LAPSSII Laboratory, Graduate School of Technology, Cadi Ayyad University, Safi, Morocco.
    2LTI Laboratory, ENSA, Chouaib Doukkali University, El Jadida, Morocco.
    3Universidad Europea del Atlantico. Isabel Torres 21, 39011 Santander, Spain.
    4Universidad Internacional Iberoamericana Campeche 24560, Mexico.
    5Universidad de La Romana. La Romana, Republica Dominicana.
    6Universidad Internacional Iberoamericana Arecibo, Puerto Rico 00613, USA.
    7Universidade Internacional do Cuanza. Cuito, Bie, Angola.
    8Department of Information and Communication Engineering, Yeungnam University, Gyeongsan 38541, South Korea.

Contact

If you have any questions or suggestions, feel free to contact us at a.chekry@uca.ac.ma.

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

pydematel-0.2.2.tar.gz (16.7 kB view details)

Uploaded Source

Built Distribution

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

pyDEMATEL-0.2.2-py3-none-any.whl (17.0 kB view details)

Uploaded Python 3

File details

Details for the file pydematel-0.2.2.tar.gz.

File metadata

  • Download URL: pydematel-0.2.2.tar.gz
  • Upload date:
  • Size: 16.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.5

File hashes

Hashes for pydematel-0.2.2.tar.gz
Algorithm Hash digest
SHA256 958304265557fb739281c52ac9a6aa357c0f674dd02b88a2130a5852dbc4422d
MD5 9e41f592468e518498bfb1547c0165d0
BLAKE2b-256 c46c48c3d2118fe4cc37fb3c9fa0ea01fbe6a3774017451ba083a7c806c78dfb

See more details on using hashes here.

File details

Details for the file pyDEMATEL-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: pyDEMATEL-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 17.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.11.5

File hashes

Hashes for pyDEMATEL-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4912bbb11cebf4ce36bf48cf84dfcbe89e2569bf2ed65c883b83a0927221fce2
MD5 879c9964b26ea88b1f0e7c985d898cc1
BLAKE2b-256 1028538f8e0a6336895b02ad87ffa55b5242275901f00bf1b38f1e43afb9a874

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