Skip to main content

No project description provided

Project description

FImdlp

CI CodeQL Codacy Badge codecov pypy https://img.shields.io/badge/python-3.11%2B-blue

Discretization algorithm based on the paper by Usama M. Fayyad and Keki B. Irani

Multi-Interval Discretization of Continuous-Valued Attributes for Classification Learning. In Proceedings of the 13th International Joint Conference on Artificial Intelligence (IJCAI-95), pages 1022-1027, Montreal, Canada, August 1995.

Installation

From PyPI

pip install FImdlp

From source (development)

The project no longer relies on a git submodule — the C++ sources live under src/cpp/. A regular clone is enough:

git clone https://github.com/doctorado-ml/FImdlp.git
cd FImdlp
make deps      # install the [dev] extras (build, twine, pip-audit, black, flake8, coverage)
make install   # editable install; compiles the Cython/C++ extension in place

Run make help to list every available target.

Quick start

from sklearn.datasets import load_iris
from fimdlp.mdlp import FImdlp

X, y = load_iris(return_X_y=True)
clf = FImdlp().fit(X, y)

# Discretize
X_disc = clf.transform(X)

# Inspect cut points: [vmin, c1, ..., cn, vmax] per feature
for f, cuts in enumerate(clf.get_cut_points()):
    print(f"feature {f}: {cuts}")

Constructor parameters:

Parameter Default Description
n_jobs -1 Threads for per-feature fit/transform. -1 uses all cores.
min_length 3 Minimum samples in an interval to consider further splits.
max_depth 1e6 Maximum recursion depth of the splitting procedure.
max_cuts 0 Cap on intermediate cut points per feature (0 = unlimited; <1 is interpreted as a fraction of samples).

Make targets

Target What it does
make help List every target.
make deps Install the [dev] extras (build, twine, pip-audit, black, flake8, coverage).
make install Editable install (pip install -e .); rebuilds the C++/Cython extension.
make test Run unit tests with coverage. Rebuilds the extension if the .so is missing.
make coverage Run tests then print the coverage report.
make lint Format with black and lint with flake8.
make build Produce wheel + sdist in dist/.
make publish make build + twine check + twine upload.
make audit Run pip-audit on the installed packages.
make sample_py Run the Python sample on the iris dataset.
make sample_cpp Build and run the C++ sample on the iris dataset.
make version Show Python, FImdlp and bundled mdlp versions.
make clean Remove build artifacts, caches and the compiled extension.

Running the samples

Python sample

make sample_py
# equivalent to:
#   cd samples && python sample.py iris

Other options:

python samples/sample.py iris            # default settings
python samples/sample.py iris -c 2       # cap intermediate cut points to 2
python samples/sample.py iris -m 3       # cap recursion depth to 3
python samples/sample.py iris -n 25      # set min_length to 25
python samples/sample.py -h              # full option list

C++ sample

make sample_cpp
# equivalent to:
#   cd samples && cmake -B build -S . && cmake --build build && cd build && ./sample -f iris

Other options:

cd samples/build
./sample -f iris -c 2     # cap intermediate cut points to 2
./sample -f glass -m 3    # change dataset and depth
./sample -h               # full option list

Based on

https://github.com/rmontanana/mdlp

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

fimdlp-1.0.1.tar.gz (14.9 kB view details)

Uploaded Source

Built Distributions

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

fimdlp-1.0.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (913.7 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.17+ x86-64

fimdlp-1.0.1-cp314-cp314-macosx_12_0_arm64.whl (71.0 kB view details)

Uploaded CPython 3.14macOS 12.0+ ARM64

fimdlp-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (916.0 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ x86-64

fimdlp-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (930.1 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ x86-64

fimdlp-1.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (906.5 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

File details

Details for the file fimdlp-1.0.1.tar.gz.

File metadata

  • Download URL: fimdlp-1.0.1.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.3

File hashes

Hashes for fimdlp-1.0.1.tar.gz
Algorithm Hash digest
SHA256 c47f926b369c736dbee76fd0f854f2110b3d93e8476e28afe1fef13832a46fac
MD5 cabb966dbbb3e85c9d07432f01a37fed
BLAKE2b-256 3a628f31f3c3069ef32b69148c03c8cd8c8632d65df08765aec261b2c0d9bdc0

See more details on using hashes here.

File details

Details for the file fimdlp-1.0.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fimdlp-1.0.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 d7dffabbaaf077973728376fcede22f35e1067378977061b53833b7c5192a532
MD5 d962fde1519005af9ba460563930dcd2
BLAKE2b-256 d502819990c9285c3a46339a948003c35b87344212ce400c432ca234e5b8b582

See more details on using hashes here.

File details

Details for the file fimdlp-1.0.1-cp314-cp314-macosx_12_0_arm64.whl.

File metadata

File hashes

Hashes for fimdlp-1.0.1-cp314-cp314-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 650b174cad8f211cfcfd129677c1736292eeaf3651948fc0ce9a149f82e8741d
MD5 419f76cfe72c3e1d96c2e996978806b1
BLAKE2b-256 1ae0900cadba478f6c17584b67a0f59dd29df16e7ae34eaf66d10b63fd0fea79

See more details on using hashes here.

File details

Details for the file fimdlp-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fimdlp-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 1a0f5d163a2d621b102dd19f544a03a9a0978a6c6272f86faaceb2ad1cb4a7c4
MD5 d58251fd574f03419e1e883132868253
BLAKE2b-256 a16316d96a8eace0c06c258e82591ccfd3d040834707dc0815932c1eaab6115e

See more details on using hashes here.

File details

Details for the file fimdlp-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fimdlp-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 93659ada6a356317e0724267bff2888374e4f7c94790fca3c4130ac0fab10b74
MD5 5ee18371eb6940db23fa02cbefb7fc49
BLAKE2b-256 56f0528aa3c1ba60ad980e379cf8bd3b3d136de3a281392f483a1548ab834a37

See more details on using hashes here.

File details

Details for the file fimdlp-1.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fimdlp-1.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 9f0d99440182c8231a37a0e3692cb9647cea9b5bbcbe36593c97acb19dd303fc
MD5 355c83a917e1370bbedf180e22324ff3
BLAKE2b-256 3df7cb202a5d94e514a0e3dba53b0cffe39b6c418c8f358b2d3c8ce0351103fa

See more details on using hashes here.

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