Code Monkey home page Code Monkey logo

gpmm's Introduction

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.

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.