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.


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:


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.

Files for fuzzy-systems, version 0.3.0
Filename, size File type Python version Upload date Hashes
Filename, size fuzzy_systems-0.3.0-py3-none-any.whl (7.6 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size fuzzy_systems-0.3.0.tar.gz (70.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page