Skip to content

About

Fuzzy computing for Python: fuzzy sets, membership functions, linguistic scales, operators and defuzzification. Dependency-free scalar core, optional NumPy batches, reproducible neural examples and quickstarts for people and AI agents.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Repository files navigation

Alice in the Fuzzy Technologies research laboratory

FuzzyRoutines

Turn measurements into interpretable linguistic grades with explicit fuzzy mathematics.

Classify measurements, combine fuzzy criteria, inspect sets and explain results. CPython 3.13–3.14 · no mandatory runtime dependencies · Apache-2.0

Documentation · Русский · 简体中文

Try it: is 24 °C comfortable or warm?

This source describes FuzzyRoutines 2.1.0. Install that exact version:

python -m pip install fuzzyroutines==2.1.0

If 2.1.0 is not yet available on PyPI, install the reviewed CI wheel using the version-aware agent guide. The published 2.0.0 baseline remains available for reproducing earlier results.

from fuzzyroutines import (
    ContinuousUniverse, LinguisticScale, LinguisticTerm,
    ScalarFuzzySet, SShoulder, Triangle,
)

universe = ContinuousUniverse(0, 40, leftClosed=True, rightClosed=True)
scale = LinguisticScale((
    LinguisticTerm("Comfort", ScalarFuzzySet(universe, Triangle(16, 22, 28))),
    LinguisticTerm("Warm", ScalarFuzzySet(universe, SShoulder(22, 30))),
))
result = scale.Fuzzify(24)
print({item.term.name: round(item.grade, 3) for item in result.memberships})
print(result.selectedTerms[0].name)
{'Comfort': 0.667, 'Warm': 0.125}
Comfort

These illustrative thresholds define the model. Membership grades describe how well the measurement fits each concept; they are not probabilities and need not sum to one. The two terms do not cover every temperature.

Comfort and Warm at 24 °C

Use with your AI assistant

Copy this request:

Use FuzzyRoutines 2.1.0 and its modern Python API to classify a 24 °C measurement. Read the version-aware quick start below, use the reviewed CI wheel if 2.1.0 is unavailable on PyPI, and verify Python and the installed package version, run the example and check Comfort = 2/3, Warm = 0.125, selected label = Comfort. Return the code and observed values. Explain the chosen thresholds and distinguish membership grades from probabilities. If Python execution is unavailable, label the output as expected.

2.1 quick start · Agent guide and capability map

Explore a useful scenario

These tagged 2.0 baseline guides describe scalar operations preserved in 2.1.

Goal Start here
Classify a measurement Temperature example
Choose membership curves Membership gallery
Combine criteria, inspect results Worked examples
Maintain existing 1.x software Compatibility and migration

Explore 2.1 features

FuzzyRoutines 2.1 adds the historical Universal Fuzzy Scale factory, linguistic encodings, traced Mamdani and Sugeno inference, explicit NumPy batches and optional CPU neural examples. The scalar core keeps zero mandatory runtime dependencies.

For installation checks and the new APIs, use the version-aware agent guide and a 2.1.0 package matching the reviewed source revision. Release review #348 records the reviewed release evidence.

Learn more and contribute

The published /latest/ reference moves with approved releases. Use matching tagged sources when reproducing an older version.

License

Apache-2.0. Preserve the license and NOTICE.

About

Fuzzy computing for Python: fuzzy sets, membership functions, linguistic scales, operators and defuzzification. Dependency-free scalar core, optional NumPy batches, reproducible neural examples and quickstarts for people and AI agents.

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages