FImdlp
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
Metadata
Release files for FImdlp 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| fimdlp-1.0.1.tar.gz | 14.9 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| fimdlp-1.0.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.14 | CPython 3.14 | Linux glibc 2.17+ x86-64 | Details |
| fimdlp-1.0.1-cp314-cp314-macosx_12_0_arm64.whl | CPython 3.14 | CPython 3.14 | macOS 12.0+ ARM64 | Details |
| fimdlp-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.13 | CPython 3.13 | Linux glibc 2.17+ x86-64 | Details |
| fimdlp-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.17+ x86-64 | Details |
| fimdlp-1.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl | CPython 3.11 | CPython 3.11 | Linux glibc 2.17+ x86-64 | Details |
Total release size: 3.8 MB
Release files / fimdlp-1.0.1.tar.gz
| Download URL | fimdlp-1.0.1.tar.gz |
|---|---|
| Size | 14.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c47f926b369c736dbee76fd0f854f2110b3d93e8476e28afe1fef13832a46fac
|
|
BLAKE2b-256 checksum How to use checksums |
3a628f31f3c3069ef32b69148c03c8cd8c8632d65df08765aec261b2c0d9bdc0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / fimdlp-1.0.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | fimdlp-1.0.1-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 913.7 kB |
| Tags | CPython 3.14 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
d7dffabbaaf077973728376fcede22f35e1067378977061b53833b7c5192a532
|
|
BLAKE2b-256 checksum How to use checksums |
d502819990c9285c3a46339a948003c35b87344212ce400c432ca234e5b8b582
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / fimdlp-1.0.1-cp314-cp314-macosx_12_0_arm64.whl
| Download URL | fimdlp-1.0.1-cp314-cp314-macosx_12_0_arm64.whl |
|---|---|
| Size | 71.0 kB |
| Tags | CPython 3.14 macOS 12.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
650b174cad8f211cfcfd129677c1736292eeaf3651948fc0ce9a149f82e8741d
|
|
BLAKE2b-256 checksum How to use checksums |
1ae0900cadba478f6c17584b67a0f59dd29df16e7ae34eaf66d10b63fd0fea79
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / fimdlp-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | fimdlp-1.0.1-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 916.0 kB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
1a0f5d163a2d621b102dd19f544a03a9a0978a6c6272f86faaceb2ad1cb4a7c4
|
|
BLAKE2b-256 checksum How to use checksums |
a16316d96a8eace0c06c258e82591ccfd3d040834707dc0815932c1eaab6115e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / fimdlp-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | fimdlp-1.0.1-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 930.1 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
93659ada6a356317e0724267bff2888374e4f7c94790fca3c4130ac0fab10b74
|
|
BLAKE2b-256 checksum How to use checksums |
56f0528aa3c1ba60ad980e379cf8bd3b3d136de3a281392f483a1548ab834a37
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|
Release files / fimdlp-1.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
| Download URL | fimdlp-1.0.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl |
|---|---|
| Size | 906.5 kB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
9f0d99440182c8231a37a0e3692cb9647cea9b5bbcbe36593c97acb19dd303fc
|
|
BLAKE2b-256 checksum How to use checksums |
3df7cb202a5d94e514a0e3dba53b0cffe39b6c418c8f358b2d3c8ce0351103fa
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.3
|