Skip to main content

Library for ULOWA operations, given fuzzy numbers

Project description

ULOWA MODULE

Please, read carefully before using this library.

This module implements the ULOWA aggregation operator: Unbalanced Linguistic Ordered Weighted Average. Aggregation operators for linguistic variables usually assume uniform and symmetrical distribution of the linguistic terms that define the variable. However, there are some problems where an unbalanced set of linguistic terms is more appropriate to describe the objects. ULOWA accepts a set of linguistic labels defined with unbalanced fuzzy sets. The fuzzy sets must define a fuzzy partition on the set of reference values. They can be defined by trapezoidal or triangular membership functions.

This module has been made for academic purposes. If you want to use it, cite the author.

1. Installation

First, you can simpy install it by using the pip comand: pip install ulowa

2. Usage

2.1. ULOWA

The aggregation operator works with a fuzzy linguistic scale. First, it is necessary to define the set of labels (vocabulary) and their corresponding fuzzy sets. Labels must be ordered increasingly, from the worst value to the best. labels = ["VL", "L", "M", "AH", "H", "VH", "P"]

Fuzzy sets will be trapezoidal and so each one is defined by four 4 points on a numerical scale of reference, e.g: fuzzySets = [[0.0, 0.0, 1.0, 2.0], [1.0, 2.0, 4.0, 5.0], [4.0, 5.0, 5.0, 6.0], [5.0, 6.0, 6.0, 7.0], [6.0, 7.0, 8.0, 8.5], [8.0, 8.5, 9.0, 9.5], [9.0, 9.5, 10.0, 10.0]]

Note that the scale may vary, it isn't compulsory to be from 0 to 10

ULOWA also needs a vector of weights that define the aggregation policy (from conjunctive to disjunctive). Weights are not importances for the criteria, but for the values on each rank position, e.g: weights = [0.6, 0.2, 0.2, 0.0, 0.0]

Note that the weights must sum up to 1

The labels to be aggregated will be also introduced as a vector of lables. They do not need to be in any order. values = ["VL", "VL", "L", "M", "L"]

To call to the ULOWA function is the following: ulowa(values, weights, fuzzySets, labels)

The output will be one of the linguistic labels of the vocabulary.

2.2. Defuzzification

To transform the output of ULOWA into a number, one can use defuzzification opeations. There are three methods implemented in this package: defuzzifyCOG(fuzzyNumbers, labels, tag) that is the method of Center of Gravity defuzzifyCOM(fuzzyNumbers, labels, tag) that is the method of Center of Maximum defuzzifyOrdinal(labels, tag) that is a method that returns the position of the tag in the vocabulary

2.3. Specificity and Fuzziness

This module also allows you to calculate the specificity and fuzziness of a given fuzzy set. The function needs the position of the label in the vocabulary and the min and max of the reference numerical scale. For example:

a = fuzzySets[0][0]
b = fuzzySets[len(fuzzySets) - 1][3]
order=1
for i in fuzzySets:
    print(f"\nThe specificity of the {order} fuzzy set is: {specificity(i, a, b)}")
    print(f"\nThe fuzziness of the {order} fuzzy set is: {fuzziness(i, a, b)}")
    order = order + 1

2.4. Plotting fuzzy sets

The package also provides a method to plot the fuzzy sets of the linguistic scale: plotFuzzySets(fuzzySets, labels). Here you have an example for a specific set of fuzzy numbers and labels:

fuzzySets = [[0.0, 0.0, 1.0, 2.0], [1.0, 2.0, 2.0, 3.0], [2.0, 3.0, 3.0, 4.0], [3.0, 4.0, 4.0, 5.0],
                [4.0, 5.0, 5.0, 6.0], [5.0, 6.0, 6.0, 7.0], [6.0, 7.0, 7.0, 8.0], [7.0, 8.0, 8.0, 9.0],
                [8.0, 9.0, 10.0, 10.0]]
labels = ["N", "VL", "L", "AM", "M", "AH", "H", "VH", "P"]

plotFuzzySets(fuzzySets, labels)

You should get an image like the one showed below: fuzzy sets example

Author: Universitat Rovira i Virgili (URV) - ITAKA research group (Ignacio Miguel Rodríguez)

Reference: A. Valls, The Unbalanced Linguistic Ordered Weighted Averaging Operator, In: Proc. IEEE International Conference on Fuzzy Systems, FUZZ-IEEE 2010, IEEE Computer Society, Barcelona, Catalonia, 2010, pp. 3063-3070. ULOWA article

Contact: Send e-mail

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

ulowa-1.1.0.tar.gz (6.6 kB view details)

Uploaded Source

Built Distribution

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

ulowa-1.1.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file ulowa-1.1.0.tar.gz.

File metadata

  • Download URL: ulowa-1.1.0.tar.gz
  • Upload date:
  • Size: 6.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.13

File hashes

Hashes for ulowa-1.1.0.tar.gz
Algorithm Hash digest
SHA256 f5c7d28cc5cf55912550f062bc7df9488f8f74231b3f359b9ce16245afcb82bf
MD5 773161ec93d07895d3ba3d781cef7643
BLAKE2b-256 c40c6a3cf129cd61cd256103384f8ffe990e9482d248fee170ce1967261980ff

See more details on using hashes here.

File details

Details for the file ulowa-1.1.0-py3-none-any.whl.

File metadata

  • Download URL: ulowa-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 6.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.8.3 keyring/23.4.1 rfc3986/1.5.0 colorama/0.4.4 CPython/3.6.13

File hashes

Hashes for ulowa-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b41a7b6210e1d52799163d7e88c7426c520541c9a22afd993582a01c778b466a
MD5 91c01da8cb9f7c947a921c74931e2d5c
BLAKE2b-256 dcb0bd3fdd86708cf59f7ccbe7d735f63f2571159ced2a57597de9d7511b7587

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