A modern, modular, and extensible fuzzy computation library for Python.
AxisFuzzy is designed for research and engineering in fuzzy logic, fuzzy sets, and fuzzy control, with a focus on performance, extensibility, and user experience.
- 🧠 Comprehensive fuzzy logic operations (AND, OR, NOT, etc.)
- 📈 Multiple membership functions (Gaussian, triangular, trapezoidal, custom)
- ⚡ High-performance fuzzy number & array structures
- 🧩 Highly extensible architecture: add new fuzzy types, strategies, and operations easily
- 🛠️ Unified configuration system for global settings and behaviors
- 🌫️ Flexible fuzzification engine for converting crisp values to fuzzy numbers
- 🎲 Random fuzzy number generation with reproducibility and NumPy-based vectorization
- 🔌 Extension & mixin systems for semantic and structural feature expansion
- 🚀 Full support for batch operations via NumPy backend
AxisFuzzy is built around several core subsystems:
- Core: Main data structures (
Fuzznum,Fuzzarray), type registration, operation scheduling, and high-performance computation using NumPy. - Config: Centralized configuration management with type safety, validation, and JSON-based persistence.
- Fuzzifier & Membership: Flexible engine for fuzzification and a rich set of membership functions.
- Extension & Mixin: Dual-track system for semantic (type-dependent) and structural (type-agnostic) feature expansion.
- Random: Unified, extensible random fuzzy number generation with seed management for reproducibility.
- Register: Guides users to integrate new fuzzy types, strategies, and extensions into the AxisFuzzy ecosystem.
AxisFuzzy is now available on PyPI and can be installed directly with pip:
# Basic installation (core functionality only)
pip install axisfuzzy
# Full installation (includes all analysis features)
pip install axisfuzzy[all]
# Analysis features only
pip install axisfuzzy[analysis]For the latest development version, install from GitHub:
git clone https://github.com/yibocat/AxisFuzzy.git
cd AxisFuzzy
pip install -e .Here are some simple examples to get started with AxisFuzzy:
import axisfuzzy as afa = af.fuzznum((0.5, 0.3))
b = af.fuzznum((0.3, 0.4))
result = a + b
print(result) # <0.65, 0.12>rand_fuzz = af.random.rand()
print(rand_fuzz) # <0.1247, 0.5132>doc/fuzzy-config/01_overview.md: Configuration systemdoc/fuzzy-core/01_overview.md: Core architecturedoc/fuzzy-extension/01_overview.md: Extension & mixin systemsdoc/fuzzy-fuzzifier/01_overview.md: Fuzzification & membership functionsdoc/fuzzy-random/01_overview.md: Random fuzzy number generationdoc/fuzzy-register/01_overview.md: Fuzzy type registration guide
For an overall introduction, see .github/copilot-instructions.md.
AxisFuzzy uses a modular dependency system. You can install only the core, or add analysis, development, or documentation features as needed. All dependencies are managed via requirements files and pyproject.toml.
numpy(>=2.2.6): Core numerical computationnumba(>=0.61.2): JIT compilation for performance
pandas(>=2.3.2): Data analysismatplotlib(>=3.10.5): Plottingnetworkx(>=3.0): Network analysispydot(>=1.4.0): Graph visualization
- Basic installation (
pip install axisfuzzy): Core fuzzy computation functionality only, requiresnumpyandnumba - Analysis features (
pip install axisfuzzy[analysis]): Includes additional libraries likepandas,matplotlib,networkx,pydotfor analysis and visualization - Full installation (
pip install axisfuzzy[all]): All features and dependencies included
Note: It is strongly recommended to use a virtual environment (e.g.,
venvorconda) for installation and dependency management.
AxisFuzzy uses an intelligent lazy import system that allows core functionality to work even when optional dependencies are missing. Analysis module components (like FuzzyDataFrame, FuzzyPipeline, etc.) automatically check and import required dependencies when first used, providing a better user experience.
AxisFuzzy is released under the MIT License.
Questions, suggestions, or want to contribute? Open an issue or pull request on GitHub!