Skip to content

Haghrah/PyIT2FLS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyIT2FLS

NumPy and SciPy based toolkit for Type 1 and Interval Type 2 Fuzzy Logic Systems.

Licence

PyIT2FLS is published under MIT license. If you are using the developed toolkit, please cite preprint of our paper PyIT2FLS: A New Python Toolkit for Interval Type 2 Fuzzy Logic Systems.

BibTeX:

@misc{haghrah2019pyit2fls,
    title={PyIT2FLS: A New Python Toolkit for Interval Type 2 Fuzzy Logic Systems},
    author={Amir Arslan Haghrah and Sehraneh Ghaemi},
    year={2019},
    eprint={1909.10051},
    archivePrefix={arXiv},
    primaryClass={eess.SY}
}

MLA:

Haghrah, Amir Arslan, and Sehraneh Ghaemi. "PyIT2FLS: A New Python Toolkit for Interval Type 2 Fuzzy Logic Systems." arXiv preprint arXiv:1909.10051 (2019).

Installation

PyIT2FLS can be installed by unzipping the source code in a directory and using this command inside the PyIT2FLS folder:

pip3 install .

Or you can install from PyPI:

pip3 install --upgrade pyit2fls

Support My Work with Tether (USDT)

If you find this Python library useful and would like to support its development, donations are greatly appreciated. To donate USDT, please send to the following wallet address: 0x2c0fb11b56b10b5ddda6a8c9c1f6d0b559153de2. Ensure you select the Avalanche C-Chain network when making the transaction. Using the wrong network, such as Ethereum, may result in lost funds.

Thank you for your contribution, which helps maintain and improve this project!

Versions

Features coming up in the next version

  • Supporting Generalized Type 2 Fuzzy Sets and Systems.
  • Supporting FCL.
  • Introduction of a GUI for facilitating system design.

Some notes on version 0.8.1-0.8.2

  • Just some minor edits and improvements ...

Some notes on version 0.8.0

  • Starting initial support of machine learning models based on fuzzy systems. Based on optimization for execution time or linguistic interpretability of the results, these models may have different computational efficiencies.
    • Type 1 TSK Model
    • Type 1 Mamdani Model
    • Interval Type 2 TSK Model
    • Interval Type 2 Mamdani Model
  • Starting initial support of Takagi-Sugeno models, widely used in dynamic systems control:
    • Type 1 Takagi-Sugeno System
    • Interval Type 2 Takagi-Sugeno System
  • Documentations have been enhanced and published over readthedocs. More enhancements are on the way with more tutorials and examples.
  • Some functions were deprecated in SciPy, NumPy, and Matplotlib. There are updates concerning this issue.
  • More exception handling have been done in the new version of the PyIT2FLS, but not completed, yet.
  • Minor enhancements have been made in plotting functions.

While we strive for quality and reliability, no software is perfect. If you encounter any issues or have suggestions, we warmly welcome your feedback. Your input is invaluable and helps us continue improving PyIT2FLS for the community. Please report any bugs or share your thoughts via opening a new issue. Thank you for your support and for being part of our journey to make PyIT2FLS even better!

Some notes on version 0.7.9

  • Some bugs (concerning EIASC algorithm) have been fixed in this version.

Some notes on version 0.7.8

  • Some bugs have been fixed in this version.

Some notes on version 0.7.0-0.7.7

  • Supporting fuzzy matrices and related operators.

  • Faster IT2 FLS evaluation (Please visit typereduction package).

  • Introduction of emphasize function for both type 1 and interval type 2 fuzzy sets (See 16th example).

  • New options while calling plot functions (T1FS.plot, IT2FS.plot, T1FS_plot, IT2FS_plot, and TR_plot) have been added.

    • Users can specify the output file format (png, eps, pdf, etc.) while calling the plot function by setting the ext input parameter (with pdf default value).
    • Users can edit the status of the grid in the output plot by setting the grid input parameter (with True default value).
    • Users can edit the x and y-labels by setting the input parameters xlabel and ylabel, respectively. The default value of the xlabel is Domain, and the default value of the ylabel is Membership degree.
  • There are some deprecated functions and classes. After releasing version 1.0.0, deprecated functions and classes will no longer be supported. So:

    • Please use the function IT2FS_LGaussian_UncertStd instead of L_IT2FS_Gaussian_UncertStd.
    • Please use the function IT2FS_RGaussian_UncertStd instead of R_IT2FS_Gaussian_UncertStd.
    • Please use the class IT2Mamdani instead of IT2FLS.
    • Please use the class IT2Mamdani instead of Mamdani.
    • Please use the class IT2TSK instead of TSK.

Some notes on version 0.6.1

  • Some bugs have been fixed in this version.

Some notes on version 0.6

  • Supporting Type 1 Fuzzy Sets and Systems.
  • Supporting elliptic and semi-elliptic membership functions.
  • Supporting generalized bell shaped membership function.
  • Supporting many new t-norms and s-norms.
  • Some bugs have been fixed in this version.

Some notes on version 0.5

  • Supporting both Mamdani and TSK systems.
  • Some bugs have been fixed in this vesion. Now, it is possible to use different domains for FLS inputs and outputs.

Some notes on version 0.4

  • Some bugs have been fixed in this version especially in type reduction algorithms. I would like to say thanks to Dr. K.B Badri Narayanan for reporting the errors.
  • Some new IT2FSs have been added to the toolkit.
  • In previous versions, the height of the IT2FS_Gaussian_UncertStd and IT2FS_Gaussian_UncertMean IT2FSs was fixed to 1, by default. But in the new version, user must give the height value in the parameters list as the last element.

Examples

Some initial examples of using PyIT2FLS are provided below. All the examples are tested with just the latest version of the PyIT2FLS and they may be incompatible with older versions. So, please update your PyIT2FLS to the latest version.

  • Ex1: Defining an Interval Type 2 Fuzzy Set (IT2FS).

  • Ex2: Using join and meet operators and plotting the outputs.

  • Ex3: Defining a simple (MIMO) IT2Mamdani.

  • Ex4: Prediction of the Mackey-Glass chaotic time series with PSO-based parameter tuning.

  • Ex5: Designing Interval Type 2 Fuzzy PID (IT2FPID) controller for a time-delay linear system.

  • Ex6: Creating and plotting some different types of interval type two fuzzy sets.

  • Ex7: Defining a simple multi-input multi-output IT2 TSK FLS.

  • Ex8: Defining a multi-input multi-output IT2 TSK FLS and plotting the resulting 3D output planes.

  • Ex9: Defining a multi-input multi-output IT2FLS with different domains for each of input and output variables, and plotting the output surfaces of the system.

  • Ex10: Generating random rule-bases.

  • Ex11: Using six different t-norms with meet operator.

  • Ex12: Using six different s-norms with join operator.

  • Ex13: MIMO Type 1 Mamdani Fuzzy Logic System.

  • Ex14: MIMO Type 1 TSK Fuzzy Logic System.

  • Ex15: Using emphasize function for type 1 and interval type 2 fuzzy sets.

  • Ex16: Example concerning fuzzy matrices.

  • Ex17: Defining random rules and random sets for IT2F classifier with three inputs and one output (Based on the request of one of the users).

  • Ex18: Fitting a 3D surface using type 1 TSK model and PSO algorithm.

  • Ex19: Fitting a 3D surface using type 1 Mamdani model and GA algorithm.

  • Ex20: Fitting a 3D surface using interval type 2 TSK model and GA algorithm.

  • Ex21: Fitting a 3D surface using interval type 2 Mamdani model and PSO algorithm.

  • Ex22: Using type 1 Takagi-Sugeno model for approximating a nonlinear system.

  • Ex23: Using interval type 2 Takagi-Sugeno model for approximating a nonlinear system.

  • Ex24: Example for new MEET and JOIN functions accepting many IT2FS s as input.