Skip to main content

FITRON: adaptive fuzzy-tree MCDM decision engine

Project description

FITRON

FITRON is a Python package for hybrid decision intelligence under uncertainty.

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

Why FITRON

Most pipelines stop at classification. FITRON extends that flow into adaptive decision ranking.

  1. Learns a predictive backbone with a decision tree.
  2. Ranks valid candidates with TOPSIS and learned criteria weights.
  3. Adapts weights over iterations using memory and exploration.
  4. Produces feature-level explanations for selected options.

Core Workflow

  1. Preprocess tabular data and encode features.
  2. Fuzzify numeric features into low/mid/high memberships.
  3. Train decision tree model and estimate feature importances.
  4. Filter valid candidates using model predictions.
  5. Rank candidates with TOPSIS.
  6. Update weights using adaptive exploration and memory feedback.
  7. 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:

  1. Confirm Python 3.10+ is available:
python3 --version
  1. If venv is missing on Linux, install it first (example for Debian/Ubuntu):
sudo apt update
sudo apt install -y python3-venv
  1. Create and activate the virtual environment:
python3 -m venv .venv
source .venv/bin/activate
  1. Upgrade packaging tools and install FITRON in editable mode:
python -m pip install -U pip setuptools wheel
python -m pip install -e .[dev]
  1. Verify installation:
python -c "from fitron import FITRONModel; print('ok')"
pytest -q

Notes:

  • On some macOS setups, python3 may be installed via Homebrew and located under /opt/homebrew/bin/python3 (Apple Silicon) or /usr/local/bin/python3 (Intel).
  • Use deactivate when you are done working in the virtual environment.

Quick Start

import pandas as pd
from fitron import FITRONModel

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)

Public API

  • FITRONModel
  • fit(df, target, ...)
  • rank(df, target, ...)
  • explain(result)
  • update_memory(memory, weights, score, best_idx)

Run Tests

pytest -q

Build and Publish

Build distribution artifacts:

python -m build

Validate artifacts:

python -m twine check dist/*

Upload:

python -m twine upload --repository testpypi dist/*
python -m twine upload dist/*

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

fitron-0.1.3.tar.gz (8.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

fitron-0.1.3-py3-none-any.whl (11.0 kB view details)

Uploaded Python 3

File details

Details for the file fitron-0.1.3.tar.gz.

File metadata

  • Download URL: fitron-0.1.3.tar.gz
  • Upload date:
  • Size: 8.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fitron-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9f27ae46d258c1f16c7cf1e14d677f382ade95a4cbc3f4ee49f0e07b000ff327
MD5 3c9345227f7edfa81061809422337c5f
BLAKE2b-256 a8921ab1a59a78512e739ac1ee771e7ddced0c30b35c53a8f01680e9bedab73c

See more details on using hashes here.

Provenance

The following attestation bundles were made for fitron-0.1.3.tar.gz:

Publisher: publish.yml on hazlived/fitron

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file fitron-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: fitron-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 11.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for fitron-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 ec0330c6c06f56be095f0d47f31ee1c017c55c5de999f0176f1898ce9427a09c
MD5 082c031d380e340f3a3c4959453f5979
BLAKE2b-256 7cf520d7253c07c6eab46c13de16751d86b6fd62eb68f2ad541fc2412b4c9eef

See more details on using hashes here.

Provenance

The following attestation bundles were made for fitron-0.1.3-py3-none-any.whl:

Publisher: publish.yml on hazlived/fitron

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page