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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

fimdlp-1.0.0-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.0-cp314-cp314-macosx_12_0_arm64.whl (70.9 kB view details)

Uploaded CPython 3.14macOS 12.0+ ARM64

fimdlp-1.0.0-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.0-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.0-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.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.

File metadata

File hashes

Hashes for fimdlp-1.0.0-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 153b784dc18f32a7351ebc0cb9c8a72fd5631c8f23e41501fc11e80a3673b8f8
MD5 fc9ef24bc7232bdd8ed75524bb137cf7
BLAKE2b-256 69c54653baf49952aa145e66ebe166000e1c9de19cc3d0085daf44e2f69e316d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fimdlp-1.0.0-cp314-cp314-macosx_12_0_arm64.whl
Algorithm Hash digest
SHA256 5ab1f203ebe8425c086e5c56e73ebffdbc1c4c286ddc7eb4e5bf1454f721f9fb
MD5 80a27c79b0e6f4c95bd191f5d9a3b103
BLAKE2b-256 40e885b36b9ae767d6e757bb77473b5e0ed53b10acb7b4d6b5e1fa15a2d8e6c5

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fimdlp-1.0.0-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 6f462d2f123ba1dfda9e32cd5579d1b3a3060a6d37a2790bf50a38c19747927a
MD5 24f5eebb979f5471d1c58c5254eae115
BLAKE2b-256 f04bd55151a8931bfbc69d50c7ee92c2440a22015221e48a3b249a1821db6bb2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fimdlp-1.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 fdb09fb882577e512fd4d9620798d556c01e2babf395d203f076255f48920957
MD5 93a5e31118ab03c120cb7f1c9fc09cfe
BLAKE2b-256 23331bacc4cad6acb7f28ca793019834b6221576fc934e9bb7236c1d0b88e14d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for fimdlp-1.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Algorithm Hash digest
SHA256 8b7eccf5519d1abe00eb47d4b9cb11612a22b9839e2682eae464367f274d1f1f
MD5 5697138e580c9119c110da9836ae8324
BLAKE2b-256 11c21b2e14772554bed283c0cd34e77fb9d18588a4c7b09559d20362a7b90320

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