Skip to main content

A fuzzy system for python with fuzzy reasoning and classification.

Project description

Fuzzy system

Just a other python fuzzy rule-based system and reasoning package. Based on the lecture's given by Ning Xiong at Märlardalens University. Writen and implmented by @byteofsoren.

Installation.

pip install fuzzy_system

Basic usage

Assume that intended system for opening a valve dependent on price of electricity and the temperature in the environment.

Assume that the fuzzy set for the temperature and cost looks like this: Temperature Electricity cost This is implemented like this in this module:

>>> import python_fuzzy_system as fuzzy

>>> cold = fuzzy.fuzzy_member_pointlist([[-5,1],[5,0]])
>>> warm = fuzzy.fuzzy_member_pointlist([[0,0],[5,1],[10,1],[15,0]])
>>> hot = fuzzy.fuzzy_member_pointlist([[5,0],[15,1]])

>>> cheap = fuzzy.fuzzy_member_pointlist([[8,1],[12,0]])
>>> good = fuzzy.fuzzy_member_pointlist([[8,0],[12,1],[16,0]])
>>> expensive = fuzzy.fuzzy_member_pointlist([[12,0],[16,1]])

Now fire each individual member can be done like:

>>> cold.fire(1.5)
0.35

Creating rules for the system

Lets define a set of rules called Rn.

Rule Condition Do
R1 If Cheap AND Cold Then Open
R2 If Hot AND (Cheep OR good) Then HalfOpen
R3 If Expensive AND Hot Then Closed
r1 = cheep*cold
r2 = hot*(cheep + good)
r3 = expensive*hot

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

fuzzy_systems-0.3.0.tar.gz (70.9 kB view details)

Uploaded Source

Built Distribution

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

fuzzy_systems-0.3.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file fuzzy_systems-0.3.0.tar.gz.

File metadata

  • Download URL: fuzzy_systems-0.3.0.tar.gz
  • Upload date:
  • Size: 70.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for fuzzy_systems-0.3.0.tar.gz
Algorithm Hash digest
SHA256 5dfc94b3c3f5c801db9b404b931b2348c23af931077fa3d6bd427affd0c385ce
MD5 ba8ce2640af4e47d9b8df5dee2ba69f1
BLAKE2b-256 7acd68a4c3864f8fed99afb6b4854b2d3a1b96cc63e526045cea7d69c7f363bd

See more details on using hashes here.

File details

Details for the file fuzzy_systems-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: fuzzy_systems-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.2.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.8.1

File hashes

Hashes for fuzzy_systems-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d39f2e5166295e34dd1d5d6f01ba29b01e45dfbc664235de6306947a245cf563
MD5 b557835e12fd372553eae413ef4200db
BLAKE2b-256 9828a738d24d98a653c0fc0735f3a8831d373cf391efe58243c15f2206060da1

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