Skip to main content

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

Project description

ML Engine Core

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 30x faster than traditional Python-based ML libraries.

Installation

Install the complete suite via PyPI (this automatically installs both C++ backend engines):

pip install ml-engine-core

Modules Overview

MLEngine is divided into two primary sub-modules: classical and neural.

1. mlengine.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 mlengine.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. mlengine.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 mlengine.neural import Model, DenseLayer, ReLULayer, SoftmaxLayer, CategoricalCrossEntropyLoss

X_train = np.random.rand(100, 4).astype(np.float64)
y_train = np.eye(3)[np.random.choice(3, 100)].astype(np.float64) 

# Build Architecture
model = Model()
model.add(DenseLayer(4, 16))
model.add(ReLULayer())
model.add(DenseLayer(16, 3))
model.add(SoftmaxLayer())

model.compile(CategoricalCrossEntropyLoss())

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

probs = model.predict(X_train[:1])
print("Neural Net Probs:", probs)

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 Eigen's noalias() buffers, and returns only when finished.

In standard academic benchmarks (Iris, MNIST Digits, Olivetti Faces), MLEngine consistently achieves 2x to 30x speedups over Scikit-Learn while maintaining equal or superior accuracy. See the individual core repositories for detailed benchmark logs.

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.2.tar.gz (3.8 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.2-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ml_engine_core-0.1.2.tar.gz
  • Upload date:
  • Size: 3.8 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.2.tar.gz
Algorithm Hash digest
SHA256 01ad901a73df0a6db108e136db4ed66fe8b73bc522a9b043609480e6db89a00f
MD5 c0b82153e6e701234c25e500dd67ecb3
BLAKE2b-256 20af74d67ef3d2f31dabd66e7566e4ba7c1a9908afcd9f052b1d2025a3d7ba78

See more details on using hashes here.

Provenance

The following attestation bundles were made for ml_engine_core-0.1.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: ml_engine_core-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 4.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 dcef8dab6ae468f9551fe6ba3d28f50aacb2879ae97250b5593270a83886033a
MD5 4164e8b8f992cceeff31250464d2bd81
BLAKE2b-256 590ab773d820c4ec58e28a388a0e0b1b850284943f379643698cfd16ae3b6c60

See more details on using hashes here.

Provenance

The following attestation bundles were made for ml_engine_core-0.1.2-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