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 30x 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, 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), ml_core consistently achieves 2x to 30x speedups over Scikit-Learn while maintaining equal or superior accuracy.

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ml_engine_core-0.1.3.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.3.tar.gz
Algorithm Hash digest
SHA256 3fbb5b636e64c9961342e109284300790f9320dff8cc2a91df24f654d7c578bc
MD5 51d6c7dcfccde2e9053d134a0e356fc9
BLAKE2b-256 b8bf7c9b97008a68e0c745c82b27ded4793c28bd12dc85de5ce3cc0aa1c16a61

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: ml_engine_core-0.1.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 75cff90a42c0fe48262a124e0beb2c11c3b7708abeb8157e9792dba827a5b30e
MD5 2ce258aef561a98dedf448845e0d1ff9
BLAKE2b-256 4280138f3c5cba211c1164d289966e5a52d4d0d558ec2f7e503f3221e09f8c79

See more details on using hashes here.

Provenance

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