FuzzyCocoPython
Python bindings and scikit-learn style estimators for fuzzycoco,
an evolutionary fuzzy rule learning engine written in C++. This package wraps the C++ core as a Python module
and exposes FuzzyCocoClassifier and FuzzyCocoRegressor with a familiar fit/predict API.
Features
- Train fuzzy rule-based classifiers and regressors using
fit,predict, andscore - Inspect learned linguistic variables, rules, and activation statistics from Python
- Persist trained estimators with
save/loadhelpers based onjoblib
Installation
Install from PyPI:
pip install fuzzycocopython
Or install from source. Make sure the following prerequisites are available:
- A C++17 compiler toolchain (GCC/Clang on Linux & macOS, MSVC on Windows)
- CMake ≥ 3.21 and Ninja on your PATH
- uv is recommended for dependency management, but
pipworks just as well
Clone the repository, initialise the fuzzycoco submodule, then build and install in editable mode with uv:
git clone https://github.com/CI4CB-lab/fuzzycocopython.git
cd fuzzycocopython
git submodule update --init --recursive
uv venv
source .venv/bin/activate
uv pip install -e .
If you prefer the standard tooling, create a virtual environment manually and install with pip:
python -m venv .venv
source .venv/bin/activate
pip install -e .
When you only need the published bindings and not the repository, install straight from GitHub:
pip install git+https://github.com/CI4CB-lab/fuzzycocopython.git
For development tasks (tests, linting, docs) install the optional toolchain:
uv pip install -e '.[dev]'
The build compiles the bundled C++ bindings. Refer to the
fuzzycoco project for background on the engine itself.
Quick start
import pandas as pd
from sklearn.datasets import load_iris
from fuzzycocopython import FuzzyCocoClassifier
data = load_iris(as_frame=True)
clf = FuzzyCocoClassifier(random_state=0)
clf.fit(data.data, data.target)
preds = clf.predict(data.data)
score = clf.score(data.data, data.target)
print(f"Accuracy: {score:.3f}")
print(clf.rules_df_.head())
The estimators now expose scikit-learn style hyper-parameters for direct tuning:
from fuzzycocopython import FuzzyCocoClassifier
model = FuzzyCocoClassifier(nb_rules=10, nb_sets_in=3, random_state=42)
model.fit(X, y)
preds = model.predict(X)
Bit widths for variable and set indices are automatically derived from the training data. Override them with nb_bits_vars_in, nb_bits_sets_in, nb_bits_vars_out, or nb_bits_sets_out when you need full manual control.
For a guided tour, open demo.ipynb. Additional usage examples live in tests/test_fuzzycocopython.py.
Documentation
Full API documentation is available at CI4CB-lab.github.io/fuzzycocopython. To build the docs locally run:
uv pip install -e '.[docs]'
uv run sphinx-build -W -b html docs docs/_build/html
Pre-commit hooks
Install and activate the provided hooks (Ruff lint/format, mypy, general hygiene) once per clone:
uv run pre-commit install
Run them against the full tree when needed:
uv run pre-commit run --all-files
License
This fuzzycoco software is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
Metadata
Release files for fuzzycocopython 0.1.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fuzzycocopython-0.1.2.tar.gz | 2.0 MB | Details |
Built distributions (wheels)
Total release size: 12.4 MB
Release files / fuzzycocopython-0.1.2.tar.gz
| Download URL | fuzzycocopython-0.1.2.tar.gz |
|---|---|
| Size | 2.0 MB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b0fbe81f7132b05e47b42c47cc4bc8d4dea173f6c113106164eb44c53bb285ab
|
|
BLAKE2b-256 checksum How to use checksums |
a0624bd96bcc19dcc53c5753ad80490170e3120596d541d95bcad35693edfc94
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp313-cp313-win_amd64.whl
| Download URL | fuzzycocopython-0.1.2-cp313-cp313-win_amd64.whl |
|---|---|
| Size | 258.6 kB |
| Tags | CPython 3.13 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
34fa4db5cd05749adbbe99371955ec92308f90dd90255beb8f2735eb47dce65d
|
|
BLAKE2b-256 checksum How to use checksums |
5bce5fdacef5878976e5ab0890e43582ebc4136f55ade4509b1ad50b740f19e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp313-cp313-musllinux_1_2_x86_64.whl
| Download URL | fuzzycocopython-0.1.2-cp313-cp313-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.13 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
88329499938c111c528faf018ec7b3e0d985769a9bb47daf0555a7e6af1c9141
|
|
BLAKE2b-256 checksum How to use checksums |
ce2622891250152a00feb36e00fb1a18bb62d405ccc6f869e1afca88a3ac9c62
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | fuzzycocopython-0.1.2-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 536.3 kB |
| Tags | CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b682a776d0ed8372071de257a1881c83ce4e49a9e397a6576bfd0deb6e11e30e
|
|
BLAKE2b-256 checksum How to use checksums |
b42c56fe521cdc451125890324c11936a97d68c38f2b0ac7af7ba40977939ec9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | fuzzycocopython-0.1.2-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 316.2 kB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
f9326b688692f9a942b4ca7da172b5d9841fc3d69c00d5b5fb45122a0c241fea
|
|
BLAKE2b-256 checksum How to use checksums |
db81a59195ec505d93050dadff24b50ed45201a41271e019ce2a9f5412ff3cf6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp312-cp312-win_amd64.whl
| Download URL | fuzzycocopython-0.1.2-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 258.5 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
18e2bec9db06ba58bf48e6aae38ea51b1703bc11b2c3e0a4c448d5e67a3b4dab
|
|
BLAKE2b-256 checksum How to use checksums |
6724e83547f26b56f5176023a2de68ecd2315ca9ee7f75b4b5e5fc5d802a23b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp312-cp312-musllinux_1_2_x86_64.whl
| Download URL | fuzzycocopython-0.1.2-cp312-cp312-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
3776da5731ea111b873079d399e7f98ed75bb5e05977fb195b236c3419671686
|
|
BLAKE2b-256 checksum How to use checksums |
20120e9505dd7989be1b11fe01272c5d1ce153cce23e209e81e859436c6a2ba1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | fuzzycocopython-0.1.2-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 536.3 kB |
| Tags | CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
b7e4bcb7d43d77b0858d5c7583ef04447a12fcc364b3e912270d0a426732fffb
|
|
BLAKE2b-256 checksum How to use checksums |
6e92335f92be1269f37075704957d934bdb068d09d07572843c2e6528213a3f6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | fuzzycocopython-0.1.2-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 316.1 kB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e0b1f489572edeb1e5d1e37c30a710b0fdbb8cf79a63425b9f6fe1a52aad4a93
|
|
BLAKE2b-256 checksum How to use checksums |
49a47fdaadb1728be4e2e10bbe6a8c13faf05dfc65594248df3127c639831d51
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp311-cp311-win_amd64.whl
| Download URL | fuzzycocopython-0.1.2-cp311-cp311-win_amd64.whl |
|---|---|
| Size | 257.3 kB |
| Tags | CPython 3.11 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
8c7c059e8c436689cb726c647e9ce9646cb850c0f20dd640dcd907a51234c6d3
|
|
BLAKE2b-256 checksum How to use checksums |
a5a368561dc61be130606b4eb1c9335d323ae6238661772e0e7f320bb32694a4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp311-cp311-musllinux_1_2_x86_64.whl
| Download URL | fuzzycocopython-0.1.2-cp311-cp311-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.11 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
f9af65b786dc7a0fd466bf7df61fe736f189de685df044d30f34f300bee53816
|
|
BLAKE2b-256 checksum How to use checksums |
bc11ad2af7f9676a7b0df83910aa0c02998bde5f8941a802c4f42721f4a077b1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | fuzzycocopython-0.1.2-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 535.0 kB |
| Tags | CPython 3.11 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
d244e254b6f3fc8a2d8eea6a29e33f531e1dfd123b7d28594a9088d1c3ba094f
|
|
BLAKE2b-256 checksum How to use checksums |
8b49f8b9c8796eaf7b7c27f491635e8f6196cea44c6fe8c77d58bab1b1680883
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | fuzzycocopython-0.1.2-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 315.6 kB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
02a86009bcff469da33cefd8c7cfbbb238b80307aeacc24585a59b1355f3c845
|
|
BLAKE2b-256 checksum How to use checksums |
d0165d116bc8389a4070ba87ad9463689710b867cf016074477d11d5e6946fe1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp310-cp310-win_amd64.whl
| Download URL | fuzzycocopython-0.1.2-cp310-cp310-win_amd64.whl |
|---|---|
| Size | 256.8 kB |
| Tags | CPython 3.10 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
5fbd0385ee6fbfd6adc97f7d83066ecb9de00d9c4e93091fd8cadcbc3e8d3384
|
|
BLAKE2b-256 checksum How to use checksums |
82ed08abcee762b1e9ebda65710cc5bbc74e618c89aad9b56708694e040ebf48
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp310-cp310-musllinux_1_2_x86_64.whl
| Download URL | fuzzycocopython-0.1.2-cp310-cp310-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 1.5 MB |
| Tags | CPython 3.10 Linux musl 1.2+ x86-64 |
|
SHA-256 checksum How to use checksums |
91103c8aceb7a3a6f7dd81741f81edf86699e59d6c4e24d239ef4ecfcbb9c4ae
|
|
BLAKE2b-256 checksum How to use checksums |
5b4fe3cec4b6ef185b88d5b5daf62e46656066402e7ea65a15f4cdebb53d4f21
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
| Download URL | fuzzycocopython-0.1.2-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 534.5 kB |
| Tags | CPython 3.10 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64 |
|
SHA-256 checksum How to use checksums |
95caac5062bb2442711922951df017c4a84a2d833ac2921bfba1d12126dfe171
|
|
BLAKE2b-256 checksum How to use checksums |
cc19abcdc992e4958251ddfe6b57e7a64bd25ed11c7f9f0f6ac9a3050037088d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / fuzzycocopython-0.1.2-cp310-cp310-macosx_11_0_arm64.whl
| Download URL | fuzzycocopython-0.1.2-cp310-cp310-macosx_11_0_arm64.whl |
|---|---|
| Size | 314.4 kB |
| Tags | CPython 3.10 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e305b4b967dc063492896dd9be708a017bb11397f791795c6dd86d9e6eccb8cf
|
|
BLAKE2b-256 checksum How to use checksums |
03857996801234562c2ebc13ac73b51891dcd02ff51e06b05ce691ee7a01a787
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|