https://github.com/leynier/inferfuzzy
Inferfuzzy es un biblioteca de Python para implementar Sistemas de Inferencia Difusa
https://github.com/leynier/inferfuzzy
cuba fuzzy-logic fuzzy-matching inference-engine inference-rules matcom matcom-uh python python-3 python3 typer
Last synced: 10 days ago
JSON representation
Inferfuzzy es un biblioteca de Python para implementar Sistemas de Inferencia Difusa
- Host: GitHub
- URL: https://github.com/leynier/inferfuzzy
- Owner: leynier
- License: mit
- Created: 2020-11-23T05:38:50.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-11-26T03:01:15.000Z (over 4 years ago)
- Last Synced: 2025-05-07T23:09:11.642Z (15 days ago)
- Topics: cuba, fuzzy-logic, fuzzy-matching, inference-engine, inference-rules, matcom, matcom-uh, python, python-3, python3, typer
- Language: Python
- Homepage: https://leynier.github.io/inferfuzzy
- Size: 1.78 MB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Inferfuzzy
[](https://opensource.org/licenses/MIT)
[](https://github.com/leynier/inferfuzzy/actions?query=workflow%3ACI)
[](https://pypi.org/project/inferfuzzy)
[](https://github.com/leynier/inferfuzzy/commits)
[](https://github.com/leynier/inferfuzzy/commits)
[](https://github.com/leynier/inferfuzzy/stargazers)
[](https://github.com/leynier/inferfuzzy/network/members)
[](https://github.com/leynier/inferfuzzy)
[](https://leynier.github.io/inferfuzzy)
[](https://github.com/leynier/inferfuzzy/graphs/contributors)**Inferfuzzy** is a **Python** library to implement **Fuzzy Inference Systems**.
## Getting started
### Installation
```bash
pip install inferfuzzy
```### Usage
Creating linguistic variables and their associated fuzzy sets.
```python
variable_1 = Var("variable_name_1")
variable_1 += "set_name_1", ZMembership(1, 2)
variable_1 += "set_name_2", GaussianMembership(3, 2)
variable_1 += "set_name_3", SMembership(4, 6)variable_2 = Var("variable_name_2")
variable_2 += "set_name_4", GammaMembership(70, 100)
variable_2 += "set_name_5", LambdaMembership(40, 60, 80)
variable_2 += "set_name_6", LMembership(30, 50)
```Declaring the semantic rules and the inference method to use.
```python
mamdani = MamdaniSystem(defuzz_func=centroid_defuzzification)
mamdani += variable_1.into("set_name_1") | variable_1.into("set_name_3"), variable_2.into("set_name_5")
mamdani += variable_1.into("set_name_2"), variable_2.into("set_name_4")
```Using fuzzy inference method for user-entered values.
```python
variable_1_val = float(input())
mamdani_result: float = mamdani.infer(variable_name_1=variable_1_val)["variable_name_2"]
```