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 mlengine

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.1.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.1-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ml_engine_core-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 221aef3f5e577efb16a45926536e62ed75ea5182366930598fccc8a405555832
MD5 2032423fa3203c453d811465f34009e4
BLAKE2b-256 eb96167d352b356d904662d012c068b1d7292edac349f1006476ef4a7ecd42b5

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ml_engine_core-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 aef6bce17752dfa77900e4922874f77a7dd050b5128e042cec4e46388cb8ab8c
MD5 ccede65cca7c4f811b1c6e8171535b2c
BLAKE2b-256 d244dd02d8cda997423da3650346d14e93978e1232e58aaf097c3065ea7d3a27

See more details on using hashes here.

Provenance

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