Skip to main content

A unified, high-performance Machine Learning Framework with native C++ backends

Project description

MLEngine

PyPI version Python

MLEngine is a unified, high-performance Machine Learning framework tailored for speed and mathematical transparency.

Under the hood, MLEngine acts as a pure Python API routing to highly optimized, custom-built C++ native engines (knn-engine-core and nn-engine-core). By pushing computational bottlenecks—including the entire training loop—down into C++ via pybind11 and Eigen, MLEngine entirely bypasses the Python Global Interpreter Lock (GIL), resulting in execution speeds up to 100x faster than traditional Python-based ML libraries.

Installation

Install the complete suite via PyPI:

pip install ml-engine-core

Modules Overview

Once installed, use the unified ml_core namespace to access both classical and neural sub-modules.

1. ml_core.classical

Powered by knn-engine-core. Features a highly optimized K-Nearest Neighbors classifier with built-in native Principal Component Analysis (PCA) for dimensionality reduction.

import numpy as np
from ml_core.classical import KNNEngine, KNNConfig

X_train = np.random.rand(100, 64)
y_train = [str(i % 5) for i in range(100)]

# Configure Engine
cfg = KNNConfig()
cfg.k = 3
cfg.variance = 0.95 # Retain 95% variance via native PCA

engine = KNNEngine(cfg)
engine.train(X_train, y_train, scale=True)

predictions = engine.predict_batch(X_train[:5])
print("KNN Predictions:", predictions)

2. ml_core.neural

Powered by nn-engine-core. A multi-layer perceptron framework that executes its full mini-batch gradient descent loop entirely in C++, preventing the Python GIL from interrupting training epochs.

import numpy as np
from ml_core.neural import Model, DenseLayer, ReLULayer, SoftmaxCrossEntropyLoss, Adam

# Note: MLEngine Neural Nets are hardware-optimized for 32-bit floats
X_train = np.random.rand(100, 4).astype(np.float32)
y_train = np.eye(3)[np.random.choice(3, 100)].astype(np.float32) 

# Build Architecture
model = Model()
model.add(DenseLayer(4, 16))
model.add(ReLULayer())
model.add(DenseLayer(16, 3))
# Softmax is handled automatically by the loss function!

optimizer = Adam(learning_rate=0.01)
loss = SoftmaxCrossEntropyLoss()
model.compile(optimizer, loss)

# C++ Native Training Loop
model.fit(X_train, y_train, epochs=150, batch_size=16)

# predict() returns raw logits. Use np.argmax for classification!
logits = model.predict(X_train[:1])
print("Neural Net Logits:", logits)

Architecture & Benchmarks

MLEngine's core philosophy is Native Loop Hoisting. Rather than returning to Python after every matrix operation or epoch step, MLEngine passes pointers to C++ once, executes the entire mathematical pipeline using AVX SIMD vectorization and a zero-allocation flat-memory Autograd graph, and returns only when finished.

In standard academic benchmarks (Iris, MNIST Digits, Olivetti Faces), ml_core.neural consistently achieves up to a 100x speedup over Scikit-Learn while maintaining mathematically identical (or superior) accuracy via Log-Sum-Exp fusion.

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

ml_engine_core-0.1.4.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

ml_engine_core-0.1.4-py3-none-any.whl (4.5 kB view details)

Uploaded Python 3

File details

Details for the file ml_engine_core-0.1.4.tar.gz.

File metadata

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

File hashes

Hashes for ml_engine_core-0.1.4.tar.gz
Algorithm Hash digest
SHA256 2e68c15d639116b2db49caa0dc85de0553e5a85b04431d3f6ba247cfee0e7c0a
MD5 8724be1a4bf5a0953fe8920579625727
BLAKE2b-256 d1613bcfdb156dad064d2a813c913999e80dcd5499687b94c9c7d573f20d1fe9

See more details on using hashes here.

Provenance

The following attestation bundles were made for ml_engine_core-0.1.4.tar.gz:

Publisher: publish.yml on MLEngineProject/MLEngine

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

File details

Details for the file ml_engine_core-0.1.4-py3-none-any.whl.

File metadata

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

File hashes

Hashes for ml_engine_core-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 22355b92b39792422d8f39a057ab627faf456fa7807445c43f592bee14f77bf2
MD5 c3327e121cc5c2eb810b4bb3d73d77f2
BLAKE2b-256 da2aa74f8d34cc2c007eda41b3ff377a090be821da7e70ee50391a906a00156e

See more details on using hashes here.

Provenance

The following attestation bundles were made for ml_engine_core-0.1.4-py3-none-any.whl:

Publisher: publish.yml on MLEngineProject/MLEngine

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