Skip to main content

GPU Accelerated Feature Interaction Mining Engine

Project description

GAFIME: GPU-Accelerated Feature Interaction Mining Engine 🚀

PyPI version Python Versions License

GAFIME is a high-performance computing engine engineered to eliminate the biggest bottleneck in modern machine learning workflows: Feature Interaction Discovery.

While most data science tools prioritize ease-of-use over execution efficiency, GAFIME treats feature engineering as a low-level systems problem. By combining C++ optimization, Rust memory-safety pipelines, and cross-platform native bindings (CUDA/Metal), GAFIME bridges the gap between high-level data science and the raw power of modern hardware architectures.

📦 Installation

GAFIME ships natively compiled wheel binaries for Windows, macOS (Apple Silicon), and Linux heavily optimized for performance out-of-the-box.

Basic Install (Engine Only):

pip install gafime

Data Science Install (Includes Scikit-Learn Wrapper):

pip install gafime[sklearn]

⚡ Quickstart: The Interactive Tutorial

The fastest way to understand GAFIME's speed is to try our built-in interactive tutorial generator. Running this command will generate a pre-configured gafime_tutorial.ipynb Jupyter Notebook in your current directory with dummy feature data to instantly evaluate against:

gafime --init

🧩 Scikit-Learn Pipeline Integration

You don't need to rewrite your data pipelines to use GAFIME. By importing the GafimeSelector, you can inject GPU-accelerated feature discovery natively into sklearn.pipeline.Pipeline or GridSearchCV:

import numpy as np
from sklearn.pipeline import Pipeline
from sklearn.linear_model import LogisticRegression
from gafime.sklearn import GafimeSelector

# Define dummy data
X_train = np.random.randn(1000, 50).astype(np.float32)
y_train = np.random.randint(0, 2, size=1000).astype(np.float32)

# Create a pipeline that automatically discovers the Top 5 best Feature Interactions
# Evaluated instantly against the GPU logic and appends them to your training dataset
pipe = Pipeline([
    ('interaction_miner', GafimeSelector(k=5, backend='auto', operator='multiply')),
    ('classifier', LogisticRegression())
])

pipe.fit(X_train, y_train)

Discrete Function Search in v0.4.x

GAFIME v0.4.x adds engine-level discrete function representations for threshold and region-style signals that pure continuous pair mining can miss. v0.4.1 corrects mutual-information ranking with adaptive bins and soft-binary inside/outside MI for discrete masks.

from gafime import ComputeBudget, EngineConfig, GafimeEngine

config = EngineConfig(
    metric_names=("pearson",),
    enable_discrete_functions=True,
    discrete_mode="soft",
    discrete_ranking="split_aware",
    budget=ComputeBudget(
        max_discrete_candidates=100_000,
        max_thresholds_per_feature=9,
        max_intervals_per_feature=12,
        max_feature_pairs_for_rectangles=500,
        top_k_features_for_discrete=50,
    ),
)

report = GafimeEngine(config).analyze(X, y, feature_names=feature_names)

Implemented families include soft thresholds, soft intervals, value-gated thresholds, soft rectangles, and value-in-rectangle candidates. Discrete candidates use the same metric_names as the rest of the engine for reported metrics. Their default report ordering uses discrete_ranking="split_aware", which combines mask mutual information, soft variance reduction, and residual gain scores. In v0.4.1, mi_bins=96 is an adaptive maximum; small datasets use fewer bins automatically, while larger datasets can use up to 96. Set discrete_ranking="metric" to rank by the selected report metrics instead.

CUDA and Metal GPU paths use soft/vectorized discrete functions only. Hard discrete mode is supported only by CPU/NumPy paths and is rejected on GPU.

Rust helper APIs are exposed through:

from gafime import subfunctions

Prefer subfunctions in user-facing code rather than importing the Rust extension name directly.

Cache-Local GPU Scheduling

GAFIME uses Rust-side cache-local launch ordering so adjacent GPU equations reuse feature columns naturally. This does not reserve or pin hardware L2 cache; CUDA L2 persistence APIs are not used.

The current local NCU profile for the discrete CUDA soft kernel showed the effect of this ordering: 4.93 ms launch duration, 98.45% L2 hit rate, 3.05% DRAM throughput, 39 registers/thread, 0 spills, and 100% branch efficiency.

🌌 Why GAFIME? The Performance Ceiling

In the current data science landscape, mining interaction data (like checking Feature X * Feature Y against the target) is painfully slow on CPUs or inefficiently memory-managed on GPUs. GAFIME achieves:

  1. Hardware-Bound Execution: GAFIME targets physical memory bandwidth limits, minimizing the overhead of standard GPU python workflows. You hit the system's ceiling.
  2. Zero-Overhead Scaling: Utilizing Rust's FFI capabilities on top of optimized CUDA C++, GAFIME bypasses the Python Global Interpreter Lock (GIL) ensuring every clock cycle executes pure feature logic.
  3. Cross-Platform Scalability: Whether you're on a MacBook executing Metal fallback logic via Rust, or an RTX workstation targeting CUDA registers, GAFIME auto-discovers and optimizes for your hardware at runtime.

Caching and Branch-less Operations

GAFIME's specialized memory layout and cache-local launch ordering keep tabular feature access predictable. GPU discrete feature engineering uses branchless soft gates instead of hard threshold branches.

🛠️ Technology Stack

  • Core Engine: C++ / CUDA (Performance-critical computation paths) and Metal (Apple Silicon native acceleration)
  • Safety Pipeline & Schedulers: Rust (Memory safe FFI interface scheduling)
  • Data Science Interfacing: Python (Polars / Numpy bindings seamlessly communicating across boundaries)

✅ For being honest

-> Current release: v0.4.1.

-> The project is developed with the help of current frontier SOTA models such as Gemini 3.1 Pro (high reasoning effort) and Claude Opus 4.6 (high).

🤝 If you want

You could collaborate with me via using email to communicate 🥰

Email: hamzausta2222@gmail.com


Contributing and Advanced Usage

Looking to expand the engine metrics or compile natively yourself? Please see our detailed references:

GAFIME was conceptualized and engineered for extreme high-frequency feature permutations in complex categorical environments like Banking models.

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

gafime-0.4.1.tar.gz (162.1 kB view details)

Uploaded Source

Built Distributions

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

gafime-0.4.1-cp314-cp314-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.14Windows x86-64

gafime-0.4.1-cp314-cp314-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

gafime-0.4.1-cp314-cp314-macosx_11_0_arm64.whl (591.0 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

gafime-0.4.1-cp313-cp313-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.13Windows x86-64

gafime-0.4.1-cp313-cp313-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

gafime-0.4.1-cp313-cp313-macosx_11_0_arm64.whl (590.5 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

gafime-0.4.1-cp312-cp312-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.12Windows x86-64

gafime-0.4.1-cp312-cp312-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

gafime-0.4.1-cp312-cp312-macosx_11_0_arm64.whl (590.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gafime-0.4.1-cp311-cp311-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.11Windows x86-64

gafime-0.4.1-cp311-cp311-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

gafime-0.4.1-cp311-cp311-macosx_11_0_arm64.whl (589.5 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

gafime-0.4.1-cp310-cp310-win_amd64.whl (2.4 MB view details)

Uploaded CPython 3.10Windows x86-64

gafime-0.4.1-cp310-cp310-manylinux_2_28_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.28+ x86-64

gafime-0.4.1-cp310-cp310-macosx_11_0_arm64.whl (590.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file gafime-0.4.1.tar.gz.

File metadata

  • Download URL: gafime-0.4.1.tar.gz
  • Upload date:
  • Size: 162.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gafime-0.4.1.tar.gz
Algorithm Hash digest
SHA256 f6c951665735e6c4c89d21dabdfb3ae3e17d7bf92ff0826da414836d2fefec1b
MD5 64952ae0adeba967f1888921f3fc9cb7
BLAKE2b-256 9773a0c4063811dba12b13d77d69ef1fdd8b2a1df36e67ab296102642d2cf95c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1.tar.gz:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: gafime-0.4.1-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gafime-0.4.1-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 36545331a434431b45b4dcaced86e72e036850e40c48fda0c627a2305a9702ad
MD5 14dc4f4c105172c24c0fbe4c3d383d55
BLAKE2b-256 321c400894e60a3a8a96cf5bf841d5f5e6d1e1100676960ed3594cec078da053

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp314-cp314-win_amd64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gafime-0.4.1-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 760384ca5233d4c1e96a4129aab00c09e1ee27158df9d431ba005d933e5f84db
MD5 3f56ffd10a399f0c1e5c62e33e665fb1
BLAKE2b-256 9cf84c733b45d4b64d808670e68135b74808168ad0d8e4d3d83a4b5fb30c2993

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp314-cp314-manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gafime-0.4.1-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 268797a1eef555a67f91ca3146e9ef73235672ae7509abaf2b4e16b55aa73ee3
MD5 947b9fada9e734191f9d357cdca8c16e
BLAKE2b-256 ecaa2be02fc838af39956808926e2a66a3ae02c25e2d9c80cff7a4442377e66d

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp314-cp314-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: gafime-0.4.1-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gafime-0.4.1-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ac617076e2c2abab4172232f966ae7c7463fca7adb72e0cae160487f6859d25e
MD5 e52fc9ee6512143a04c2fec999e08a19
BLAKE2b-256 53ccea85a508c8edbb4646f366c0cfd5d4f6e557f2513b6175e5fe83fd6317ce

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp313-cp313-win_amd64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gafime-0.4.1-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0882e9771afa8058869673e28bb21642c2084c3f607cfe3aa400a87660533b3d
MD5 4a1709eb7659d446d6cb0fa4b8c9fb1c
BLAKE2b-256 54b6e100457bc47a400e9d8d0f6aea639ecf2c91ac60fe1cd32e48a817a0a994

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp313-cp313-manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gafime-0.4.1-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a722b26f33d612922a0dc6c44f181afce618d89dcc8ec92e7149901c7e256b8d
MD5 63d48fbc84fa70c1f8a4aff5f0a9c557
BLAKE2b-256 427a630a8b697162816ec303d4a500c01a4568ec1c451c3a7d65fc35f793220c

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp313-cp313-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: gafime-0.4.1-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gafime-0.4.1-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 a94d10aa0f5efe87daae8a939868ba8824cafdc67268f022f3f1345806f12ac8
MD5 c66dfa75ce3bd5326a3aa6f889523e4f
BLAKE2b-256 f98067264c2772096fa9892b167143e5e5f0b896f87a9112c1a0e02241167a09

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp312-cp312-win_amd64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gafime-0.4.1-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0899322daab691e26c6435f4b24f40e97c923815dfb30dad92b6e0dbdfdc0e6d
MD5 78ec912931e1a57cbecdc6c0b00d1766
BLAKE2b-256 8787d6d5343c0e1bbaa6b2ff2c644630e2bb7575374b17aa0feacac4b87c2964

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp312-cp312-manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gafime-0.4.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5d7d031d951a6fede8f8339c09b53979cb8694193e95f7a37456e0a4bb91979b
MD5 2a6aa27fc09f14f50d3e21efbe2ff836
BLAKE2b-256 c139d2ffbaf83c45960934b84b83229db749a2338a663e78bddc2646700016b4

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: gafime-0.4.1-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gafime-0.4.1-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 07fd6e7bfed3d27c9706ad29163a7b0c2fddd473a5e3cf97a8eefef917c0ce14
MD5 b5c3efe16efb269baf737366da7c6ca0
BLAKE2b-256 90be0c54ee02da56a44db638b4e00e460196a8bcf615b908413e2de4985296eb

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp311-cp311-win_amd64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gafime-0.4.1-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b9470ed604d09b76261efb0b1078e3bf5238fcf3dbdcce831bb0beffec8824ed
MD5 982710526dc107bccbdb5853821a2c9f
BLAKE2b-256 2003db655bb3c16045972b761dc0a8ce3ca1bd8fc1445521c577c1f5693c54a4

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp311-cp311-manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gafime-0.4.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c88e35f165f4e9d3be219b2de053ce4179df5e5556080f4c829cc742c1984a2d
MD5 34e8b8b5292333311ccc006b1258b27d
BLAKE2b-256 3a90ebb83ee9c7daa116a958e7b7f53b23b2d2a39bc3b7870f35871d12343cd6

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp311-cp311-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: gafime-0.4.1-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 2.4 MB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for gafime-0.4.1-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 4db029e4420cbd559a12854e225e9c2b10fe4e9988898f7e9ffd998940e2ebfd
MD5 6a74d7af0720e8a19fea1b788ece8c02
BLAKE2b-256 e4e3696162917f0004175c85face37506fca30f0d89c5fba3882218e2510ccf9

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp310-cp310-win_amd64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp310-cp310-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for gafime-0.4.1-cp310-cp310-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b5c9dac83b836504b678a9ce580818dfc604861a632ac8ca27a0f01e12fe68f3
MD5 70f07b8ea82544e253a3a3c08f593b28
BLAKE2b-256 4f5762ef3400a5d074d9705960ad83b8f0dd20ade832a2cb1005039006f81deb

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp310-cp310-manylinux_2_28_x86_64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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

File details

Details for the file gafime-0.4.1-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for gafime-0.4.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a19c0dea0a52779980a7026462bb7aa8c786f49417f1e81420dc063795913bc5
MD5 0b7bb1ecc58e3c17e2f25a2a832d3fa7
BLAKE2b-256 11d9725b6658130ecff5e77a581389d3ad273f207e0a2bc5fd782e48bb6d8c53

See more details on using hashes here.

Provenance

The following attestation bundles were made for gafime-0.4.1-cp310-cp310-macosx_11_0_arm64.whl:

Publisher: build_wheels.yml on onlyxItachi/GAFIME

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