Skip to main content

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 mlengine namespace to access both classical and neural sub-modules.

1. mlengine.knn

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
import mlengine as ml

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

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

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

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

2. mlengine.nn

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
import mlengine as ml

# 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) 
dataloader = ml.nn.DataLoader(X_train, y_train, batch_size=16)

# Build Architecture
class MyModel(ml.nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = self.add_module(ml.nn.DenseLayer(4, 16))
        self.relu = self.add_module(ml.nn.ReLULayer())
        self.fc2 = self.add_module(ml.nn.DenseLayer(16, 3))

    def forward(self, tape, x):
        x = self.fc1(tape, x)
        x = self.relu(tape, x)
        return self.fc2(tape, x)

model = MyModel()

# Compile & Train using C++ JIT
optimizer = ml.nn.Adam(learning_rate=0.01)
loss_fn = ml.nn.SoftmaxCrossEntropyLoss()
trainer = ml.nn.JITCompiler(model, optimizer, loss_fn)

# C++ Native Training Loop
trainer.fit(dataloader, epochs=150, verbose=True)

# 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), mlengine.nn consistently achieves up to a 100x speedup over Scikit-Learn while maintaining mathematically identical (or superior) accuracy via Log-Sum-Exp fusion.

Metadata

Release files for ml-engine-core 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ml-engine-core 0.1.5
File Size Uploaded Provenance
ml_engine_core-0.1.5.tar.gz 4.2 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for ml-engine-core 0.1.5
File Interpreter ABI Platform
ml_engine_core-0.1.5-py3-none-any.whl Python 3 none any Details

Total release size: 9.0 kB

Release files / ml_engine_core-0.1.5.tar.gz

Download URL ml_engine_core-0.1.5.tar.gz
Size 4.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f2c120c5a8a3808a0480f4c86d7fdc54bf0115cf70abd6e49d27492966686315
BLAKE2b-256 checksum
How to use checksums
770e745e94b7d529b3f623e43c1e3abe41e0e3420e83bd4b6062baf82e679ec0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 30, 2026.

Transparency log

Release files / ml_engine_core-0.1.5-py3-none-any.whl

Download URL ml_engine_core-0.1.5-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
71e936d9e82b39726cc80bc786b8e4adab37d8d3f5ef318b3a5c7c86f87ec1fa
BLAKE2b-256 checksum
How to use checksums
f2cfecbbd00802c7d98b0574aae518bb359c55b08898b298efa921927fe50134
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 30, 2026.

Transparency log

Security for ml-engine-core 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for ml_engine_core-0.1.5.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page