Skip to main content

AffineFlow-ML

PyPI version Python Build system Bindings

A high-performance Machine Learning engine for the AffineFlow ecosystem.

Designed for rapid experimentation without the Python Global Interpreter Lock (GIL) overhead, AffineFlow-ML executes compute-intensive tasks strictly in native C++ using Eigen and OpenBLAS. It features a dynamically compiled multi-architecture backend (Generic, AVX2, AVX-512) for maximum hardware-accelerated throughput safely dispatched at runtime.

Highlights

  • Dynamic Hardware Dispatch: Automatically detects your CPU at runtime to dispatch highly optimized AVX2 or AVX-512 instructions.
  • Zero-Copy Buffer Protocol: Uses Eigen::Ref and RowMajor structures to natively ingest NumPy arrays without memory duplication.
  • Advanced KNN Classifier: OpenMP parallelized C++17 implementation with efficient top-k neighbor selection (std::nth_element).
  • Distance Metrics: Native vectorized support for Euclidean, Manhattan, and Cosine distance algorithms.
  • Weighted Voting: Choose between standard uniform voting or distance-weighted predictions.
  • Adaptive PCA: Built-in dimensionality reduction with standard and thin-SVD modes for high-dimensional data.

Installation

Install the released wheel from PyPI:

pip install AffineFlow-ML

Quick Start

import numpy as np
import affineflow_ml as ml

# Example data
X_train = np.random.rand(1000, 50).astype(np.float64)
y_train = ["class_A" if x[0] > 0.5 else "class_B" for x in X_train]

# Configure the engine with new features
cfg = ml.KNNConfig()
cfg.k = 5
cfg.variance = 0.95
cfg.metric = ml.DistanceMetric.COSINE
cfg.weights = ml.Weights.DISTANCE

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

X_test = np.random.rand(10, 50).astype(np.float64)
predictions = engine.predict_batch(X_test)
print(predictions)

Performance Benchmark

AffineFlow-ML achieves strict mathematical parity with Scikit-Learn while delivering up to 5.4x faster inference and transformation pipelines on high-dimensional datasets. Powered by a multithreaded C++17 Eigen backend with dynamic hardware dispatch (AVX2/AVX-512) and OpenMP parallelism, it eliminates Python loop and GIL bottlenecks.

Dataset Metric & Weights Scikit-Learn Time AffineFlow-ML Time Speedup Accuracy
Olivetti Faces (400 samples, 4096 dims $\rightarrow$ PCA 90%) Cosine / Distance 0.4134s 0.0760s 5.44x 90.00%
Handwritten Digits (1797 samples, 64 dims $\rightarrow$ PCA 95%) Manhattan / Uniform 0.0808s 0.0354s 2.29x 98.61%
Iris Flower (150 samples, 4 dims $\rightarrow$ PCA 99%) Euclidean / Uniform 0.0105s 0.0055s 1.91x 100.00%

Metadata

Release files for AffineFlow-ML 0.1.0

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

Source distribution (sdist)

Source distribution for AffineFlow-ML 0.1.0
File Size Uploaded Provenance
affineflow_ml-0.1.0.tar.gz 17.8 kB With provenance Details

Built distributions (wheels)

Table of built distributions (wheels) for AffineFlow-ML 0.1.0
File
affineflow_ml-0.1.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
affineflow_ml-0.1.0-cp314-cp314t-macosx_26_0_arm64.whl CPython 3.14 CPython 3.14 free-threading macOS 26.0+ ARM64 Details
affineflow_ml-0.1.0-cp314-cp314-win_amd64.whl CPython 3.14 CPython 3.14 Windows x86-64 Details
affineflow_ml-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.14 CPython 3.14 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
affineflow_ml-0.1.0-cp314-cp314-macosx_26_0_arm64.whl CPython 3.14 CPython 3.14 macOS 26.0+ ARM64 Details
affineflow_ml-0.1.0-cp313-cp313-win_amd64.whl CPython 3.13 CPython 3.13 Windows x86-64 Details
affineflow_ml-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.28+ x86-64, Linux glibc 2.27+ x86-64 Details
affineflow_ml-0.1.0-cp313-cp313-macosx_26_0_arm64.whl CPython 3.13 CPython 3.13 macOS 26.0+ ARM64 Details
affineflow_ml-0.1.0-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
affineflow_ml-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.27+ x86-64, Linux glibc 2.28+ x86-64 Details
affineflow_ml-0.1.0-cp312-cp312-macosx_26_0_arm64.whl CPython 3.12 CPython 3.12 macOS 26.0+ ARM64 Details

Total release size: 54.7 MB

Release files / affineflow_ml-0.1.0.tar.gz

Download URL affineflow_ml-0.1.0.tar.gz
Size 17.8 kB
Tags Source
SHA-256 checksum
How to use checksums
faa8bfcc1a418236589a1714ce457ea956831b6cc1b92101b7f2c61f46fce0bf
BLAKE2b-256 checksum
How to use checksums
b27c68ff5049ec758323f99b008a51c497be9ca3df203ad193d806a98c579bae
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Release files / affineflow_ml-0.1.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL affineflow_ml-0.1.0-cp314-cp314t-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 12.7 MB
Tags CPython 3.14 CPython 3.14 free-threading Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
80a68afad15c18078d436b1094d99eadee97b8c73ac9a269d640c37b49ed8a14
BLAKE2b-256 checksum
How to use checksums
3f544f65c541acc87928ea3b2eddd71053548b512f61804f3da60868867d3be2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Release files / affineflow_ml-0.1.0-cp314-cp314t-macosx_26_0_arm64.whl

Download URL affineflow_ml-0.1.0-cp314-cp314t-macosx_26_0_arm64.whl
Size 433.3 kB
Tags CPython 3.14 CPython 3.14 free-threading macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
64751351e12c507e40e8643cd82ebcd7a339b7f3814b486439497700e94a79f0
BLAKE2b-256 checksum
How to use checksums
e0928761b8ea765e85d54f11d664376e5a7f769fbb2d2a3bf6fd8891fd8ef345
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Release files / affineflow_ml-0.1.0-cp314-cp314-win_amd64.whl

Download URL affineflow_ml-0.1.0-cp314-cp314-win_amd64.whl
Size 684.0 kB
Tags CPython 3.14 Windows x86-64
SHA-256 checksum
How to use checksums
cce07ca22be11a6f2e3b4df40088b742297c03c08a323787ca00de487d6c2313
BLAKE2b-256 checksum
How to use checksums
c348029dc5ab83f577d15d561f2d44d26e468f145506052149c35250f5daaf5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Release files / affineflow_ml-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL affineflow_ml-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 12.7 MB
Tags CPython 3.14 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
d735dd63517be4ed82ef5fb1bcc8f6f36a6dff4f3b439b45f081e3dd04aafc10
BLAKE2b-256 checksum
How to use checksums
f1dd9d3796d98005e5a53dc2b617bf1ff2d4cf187584722ed409a5e87e05455c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Release files / affineflow_ml-0.1.0-cp314-cp314-macosx_26_0_arm64.whl

Download URL affineflow_ml-0.1.0-cp314-cp314-macosx_26_0_arm64.whl
Size 423.8 kB
Tags CPython 3.14 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
4978af60ee07311b8d9781d1f054c8a0bec2e8fc37d540280734b87ae4dee8b3
BLAKE2b-256 checksum
How to use checksums
a827bf819e0e73cbc47de89dc45e63b7ff0649fc3f0fa5aa80b662406a420264
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Release files / affineflow_ml-0.1.0-cp313-cp313-win_amd64.whl

Download URL affineflow_ml-0.1.0-cp313-cp313-win_amd64.whl
Size 662.8 kB
Tags CPython 3.13 Windows x86-64
SHA-256 checksum
How to use checksums
fc721b42ca55ddff3f75332aa206e326edc35e31c47c8341de11f1eea007cf43
BLAKE2b-256 checksum
How to use checksums
4402a4a982a2ff407fbd77271d469a65c341f934548d63ba63970d1784779613
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Release files / affineflow_ml-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL affineflow_ml-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 12.7 MB
Tags CPython 3.13 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
1d9f607063468e27671ea50796914a5a60647b6f1a818e7fdcb15fe24b44fff3
BLAKE2b-256 checksum
How to use checksums
e2efacb2dd8e53d02df430985be80586dd402a9ddea5f26a028feb98c11b961b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Release files / affineflow_ml-0.1.0-cp313-cp313-macosx_26_0_arm64.whl

Download URL affineflow_ml-0.1.0-cp313-cp313-macosx_26_0_arm64.whl
Size 423.3 kB
Tags CPython 3.13 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
7592611b0e0363666ddac8aac5e842d8b6fe95c25013247c30b71e182d2cf45b
BLAKE2b-256 checksum
How to use checksums
be68e430a80b796868c51de3da6b109b1778aa34e052ccf1f7eff8c1e6960d69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Release files / affineflow_ml-0.1.0-cp312-cp312-win_amd64.whl

Download URL affineflow_ml-0.1.0-cp312-cp312-win_amd64.whl
Size 662.6 kB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
f7d885c753157aaecabc5c456d54ec4983c6ecc520d9bb1e218469dce10bc6ab
BLAKE2b-256 checksum
How to use checksums
2b3fbfe0228a8770c39272d54c0b3e632bd82600b198dda1197586d9ea61456a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Release files / affineflow_ml-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl

Download URL affineflow_ml-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Size 12.7 MB
Tags CPython 3.12 Linux glibc 2.27+ x86-64 Linux glibc 2.28+ x86-64
SHA-256 checksum
How to use checksums
7b8c21edbb41def1eb1fed127dd89261fddbc0f17f5349d1d2a663f7b49471b2
BLAKE2b-256 checksum
How to use checksums
5a674b18405f6498cd2c7a1ceba28266f14968a2ff0feff479dc1749b6bfeb3e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Release files / affineflow_ml-0.1.0-cp312-cp312-macosx_26_0_arm64.whl

Download URL affineflow_ml-0.1.0-cp312-cp312-macosx_26_0_arm64.whl
Size 423.3 kB
Tags CPython 3.12 macOS 26.0+ ARM64
SHA-256 checksum
How to use checksums
0d07ccda2151aa6f09c5ee54fcc29536dc320ffd4421a9bc1921e3ffbab80960
BLAKE2b-256 checksum
How to use checksums
cc171384a9f422b78aa4cb8e688a2f3c3031962adcf3fca84d5a0db56a8ce8e5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Aug 5, 2026.

Transparency log

Security for AffineFlow-ML 0.1.0

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 12 files in this release have been uploaded with provenance metadata.

Select from 12 files

Attestation for affineflow_ml-0.1.0.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 Aug 5, 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

12 release files Full provenance

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