FITRON: adaptive fuzzy-tree MCDM decision engine for generic tabular binary problems
Project description
FITRON
FITRON is a Python package for hybrid decision intelligence under uncertainty.
Current release: 1.0.0
The package combines:
- fuzzy feature transformation,
- decision tree learning,
- TOPSIS multi-criteria ranking,
- memory-guided adaptive weight updates,
- interpretable ranking outputs.
Package name on PyPI: fitron
Import path: fitron
What FITRON Supports
FITRON is designed for generic tabular decision problems where the target is binary and the feature space contains a mix of numeric and categorical variables.
It is a good fit when:
- the target can be encoded as 0/1, yes/no, true/false, approved/rejected, or another binary pair,
- the data contains structured rows with feature columns that can be normalized, encoded, and ranked,
- the goal is not only prediction, but also interpretable candidate ranking.
It is not a fit for:
- multi-class targets without adaptation,
- unstructured text or image-only problems,
- tasks where row-level ranking is not meaningful.
Why FITRON
Most pipelines stop at classification. FITRON extends that flow into adaptive decision ranking.
- Learns a predictive backbone with a decision tree.
- Ranks valid candidates with TOPSIS and learned criteria weights.
- Adapts weights over iterations using memory and exploration.
- Produces feature-level explanations for selected options.
Core Workflow
- Preprocess tabular data and encode features.
- Fuzzify numeric features into low/mid/high memberships.
- Train decision tree model and estimate feature importances.
- Filter valid candidates using model predictions.
- Rank candidates with TOPSIS.
- Update weights using adaptive exploration and memory feedback.
- Return best option, score, and explanation.
Installation
End users
pip install fitron
From source
pip install .
Editable install (development)
pip install -e .[dev]
Environment Setup
Use a standard CPython virtual environment.
Windows:
python -m venv .venv-win
.\.venv-win\Scripts\python.exe -m pip install -U pip setuptools wheel
.\.venv-win\Scripts\python.exe -m pip install -e .[dev]
If PowerShell blocks script activation, use:
.venv-win\Scripts\activate.bat
Linux or macOS:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install -U pip setuptools wheel
python -m pip install -e .[dev]
More detailed setup for Linux/macOS:
- Confirm Python 3.10+ is available:
python3 --version
- If
venvis missing on Linux, install it first (example for Debian/Ubuntu):
sudo apt update
sudo apt install -y python3-venv
- Create and activate the virtual environment:
python3 -m venv .venv
source .venv/bin/activate
- Upgrade packaging tools and install FITRON in editable mode:
python -m pip install -U pip setuptools wheel
python -m pip install -e .[dev]
- Verify installation:
python -c "from fitron import FITRONModel; print('ok')"
pytest -q
Notes:
- On some macOS setups,
python3may be installed via Homebrew and located under/opt/homebrew/bin/python3(Apple Silicon) or/usr/local/bin/python3(Intel). - Use
deactivatewhen you are done working in the virtual environment.
Quick Start
import pandas as pd
from fitron import FITRONModel, fit
sample = pd.DataFrame(
{
"income": [50000, 20000, 75000, 43000],
"risk": [0.2, 0.8, 0.3, 0.5],
"credit_score": [710, 520, 760, 640],
"target": [1, 0, 1, 1],
}
)
model = FITRONModel(iterations=5, random_state=42)
result = model.fit(sample, target="target")
print("Best index:", result.best_index)
print("Best score:", result.best_score)
print("Explanation:", result.explanation)
You can also pass binary string targets and explicit label mappings:
result = fit(
df,
target="status",
target_map={"reject": 0, "approve": 1},
)
Public API
FITRONModelfit(df, target, ...)rank(df, target, ...)explain(result)update_memory(memory, weights, score, best_idx)
Run Tests
pytest -q
Build and Publish
Release notes and version history are tracked in CHANGELOG.md.
Update flow for PyPI
- Update the version in pyproject.toml.
- Update CHANGELOG.md with the release summary.
- Run the test suite:
pytest -q
- Build the package:
python -m build
- Verify the generated distributions:
python -m twine check dist/*
- Upload to TestPyPI first:
python -m twine upload --repository testpypi dist/*
- Confirm the package installs from TestPyPI, then upload to the real PyPI index:
python -m twine upload dist/*
- Tag the release in git so the published version is easy to trace:
git tag v1.0.0
git push origin v1.0.0
Project Structure
src/pip_model/
core/
api.py
pipeline.py
tests/
examples/
pyproject.toml
Authors
- zibransheikh
- hazlived
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file fitron-1.0.0.tar.gz.
File metadata
- Download URL: fitron-1.0.0.tar.gz
- Upload date:
- Size: 14.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fd50e6a2e6c900caf0d60223dac37e3ba5476c6b486ea92cc9f2fe26179cdb9e
|
|
| MD5 |
ab9df2ddf40b8697439264bb07e46f63
|
|
| BLAKE2b-256 |
58f2c9dfec8163f0ee2f9cd45c4240cefdb8329e1108a94892f7c7f3869cdcd5
|
Provenance
The following attestation bundles were made for fitron-1.0.0.tar.gz:
Publisher:
publish.yml on hazlived/fitron
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fitron-1.0.0.tar.gz -
Subject digest:
fd50e6a2e6c900caf0d60223dac37e3ba5476c6b486ea92cc9f2fe26179cdb9e - Sigstore transparency entry: 1298770010
- Sigstore integration time:
-
Permalink:
hazlived/fitron@cbe995a35956588fa89a4f064dd482a1241270a4 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/hazlived
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cbe995a35956588fa89a4f064dd482a1241270a4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file fitron-1.0.0-py3-none-any.whl.
File metadata
- Download URL: fitron-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
272e6f6d4fe39b2d910200fcd55fd05c93258a796f8f6be437411fc1af66b978
|
|
| MD5 |
1f6d54060cb0579f56b06ea750ac9df1
|
|
| BLAKE2b-256 |
f51dcf061d0a1dbf212808c6af78270fa3f4df54fd201a1dc629bfe1d79001ef
|
Provenance
The following attestation bundles were made for fitron-1.0.0-py3-none-any.whl:
Publisher:
publish.yml on hazlived/fitron
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
fitron-1.0.0-py3-none-any.whl -
Subject digest:
272e6f6d4fe39b2d910200fcd55fd05c93258a796f8f6be437411fc1af66b978 - Sigstore transparency entry: 1298770171
- Sigstore integration time:
-
Permalink:
hazlived/fitron@cbe995a35956588fa89a4f064dd482a1241270a4 -
Branch / Tag:
refs/tags/v1.0.0 - Owner: https://github.com/hazlived
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@cbe995a35956588fa89a4f064dd482a1241270a4 -
Trigger Event:
release
-
Statement type: