Skip to content

Collection of generalized p-mean models with classic, fuzzy and unweighted approach

License

Notifications You must be signed in to change notification settings

Aaron-AALG/GPMM

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Generalized p-Mean Models

python-version pypi-version license Downloads

Collection of Generalized p-Mean Models (GPMM) with classic, fuzzy and un-weighted approach. This set of outranking methods are based on the concept of weighted generalized p-mean of a sequence $X$ as:

$$ \mathcal{M}_i^p(X,w) : [0,1]^M \to \mathbb{R} $$

In this project, we have included four different approaches:

  1. Classic (WMM): The $\mathcal{M}$ score is computed per each alternative to generate a cardinal ranking.
  2. Fuzzy (FWMM): The decision matrix is trapezoidal fuzzy shaped as $(x_L, x_1, x_2, x_R)$ with LR-representation. Then, it is satisfied that $x_L \le x_1 \le x_2 \le x_R$ per each component of the matrix. The output is a fuzzy score vector $\tilde{\mathcal{M}}$.
  3. Unweighted (UWMM): The weighting scheme is variable and it has attached a lower and upper bound per each component. As a result, it returns an interval $[\mathcal{M}_L, \mathcal{M}_U]$.
  4. Fuzzy Un-Weighted (FUWMM): It combines both approaches in the decision matrix and the weighting scheme, thus giving an output of $[\tilde{\mathcal{M}}_L, \tilde{\mathcal{M}}_U]$.

The mathematical fuzzy LR-representation of a trapezoid $(x_L, x_1, x_2, x_R)$ is depicted as follows:

x_fuzzy

Installation

You can install the GPMM library from GitHub:

git clone https://github.com/Aaron-AALG/GPMM.git
python3 -m pip install -e GPMM

You can also install it directly from PyPI:

pip install GPMM

Example

GPMM is implemented in order to manage NumPy arrays. Here is an example in which we only use three alternatives and four criteria.

import pandas as pd
import numpy as np
from GPMM.UWMM import UWMM

data = pd.DataFrame({"c1":[173, 176, 142],
                    "c2":[10, 11, 5],
                    "c3":[11.4, 12.3, 8.2],
                    "c4":[10.01, 10.48, 7.3]})
directions = ["max", "max", "min", "min"]
L = np.repeat(0.1, data.shape[1])
U = np.repeat(0.4, data.shape[1])
p = 2

x = UWMM(data, directions, L, U, p=p)

Optimization in Python

This library uses the minimize function of the scipy.optimize module to carry out the optimization problems. In particular, $M_L$ and $M_U$ are obtained one by one, thus we can apply the SLSQP method.

About

Collection of generalized p-mean models with classic, fuzzy and unweighted approach

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages