Type-1 Fuzzy Variable

Sun March 8, 2020
type2-fuzzy type2-fuzzy-library fuzzy python

The Type1FuzzyVariable class in the library is a way to define and use linguistic variables.

By a linguistic variable we mean a variable whose values are words or sentences in a natural or artificial language. For example, Age is a linguistic variable if its values are linguistic rather than numerical, i.e.,young, not young, very young, quite young, old, not very old and not very young, etc., rather than 20, 21,22, 23 (Zadeh, Lotfi Asker. “The concept of a linguistic variable and its application to approximate reasoning.” Learning systems and intelligent robots. Springer, Boston, MA, 1974. 1-10.)

This concept can be expressed programmatically using the following:

from type2fuzzy import Type1FuzzyVariable

# adding an age linguistic variable
var = Type1FuzzyVariable(0, 100, 100)

# add fuzzy sets
var.add_triangular('very young', 0, 0, 20)
var.add_triangular('young', 10, 20, 30)
var.add_triangular('adult', 20, 40, 60)
var.add_triangular('old', 50, 70, 90)
var.add_triangular('very old', 70, 100, 100)

# visualize sets
var.plot_variable()

The above code snippet will create the variable and sets and will produce the following image:

Linguistic Variable ‘age’

It is also very useful to have the ability to generate a number of fuzzy sets automatically in a linguistic variable, as this technique is sometimes used in ML applications. The function generate_sets takes a parameter n so that

$number_of_sets = (2\times n) + 1$

The following code shows how the generation function can be used to generate 7 sets:

from type2fuzzy import Type1FuzzyVariable

# adding an age linguistic variable
var = Type1FuzzyVariable(0, 100, 100)

# generate (2*3)+1 = 7 sets
var.generate_sets(3)

var.plot_variable()

The following is obtained:

Linguistic Variable ‘age’




Paper Implementation - Uncertain rule-based fuzzy logic systems Introduction and new directions-Jerry M. Mendel; Prentice-Hall, PTR, Upper Saddle River, NJ, 2001,    555pp., ISBN 0-13-040969-3. Example 9-4, page 261

October 8, 2022
type2-fuzzy type2-fuzzy-library fuzzy python IT2FS paper-workout

Type Reduction of Interval Type-2 Fuzzy Sets

April 6, 2022
type2-fuzzy type2-fuzzy-library fuzzy python IT2FS

Paper Implementation - C. Wagner and H. Hagras. 'Toward general type-2 fuzzy logic systems based on zSlices.'

A look at C. Wagner and H. Hagras. 'Toward general type-2 fuzzy logic systems based on zSlices.', working of paper examples using T2Fuzz Library
type2-fuzzy paper-workout type2-fuzzy-library fuzzy python
comments powered by Disqus


machine-learning 27 python 21 fuzzy 14 azure-ml 11 hugo_cms 11 linear-regression 10 gradient-descent 9 type2-fuzzy 8 type2-fuzzy-library 8 type1-fuzzy 5 cnc 4 dataset 4 datastore 4 it2fs 4 excel 3 paper-workout 3 r 3 c 2 c-sharp 2 experiment 2 hyperparameter-tuning 2 iot 2 model-optimization 2 programming 2 robotics 2 weiszfeld_algorithm 2 arduino 1 automl 1 classifier 1 computation 1 cost-functions 1 development 1 embedded 1 fuzzy-logic 1 game 1 javascript 1 learning 1 mathjax 1 maths 1 mxchip 1 pandas 1 pipeline 1 random_walk 1 roc 1 tools 1 vscode 1 wsl 1