A from-scratch machine learning library built with NumPy — 80+ algorithms, 120+ math tools, C++ accelerated.
Project description
mastermlx
mastermlx is a NumPy-first machine learning library built from scratch.
It gives you a broad set of classic ML algorithms, math utilities, and optional compiled acceleration in one package.
Why use it
- Clean top-level API
- 80+ algorithms for classification, regression, clustering, decomposition, NLP, RL, and bandits
- 110+ math tools for metrics, kernels, statistics, distance functions, and time series
- Optional C++ and Cython backends for speed-critical paths
- Pure Python fallback when compiled extensions are not available
Install
pip install mastermlx
If you want the latest code from GitHub:
pip install git+https://github.com/Smalleaves123/mastermlx.git
For development:
pip install -e ".[dev,compare]"
Quick Example
import numpy as np
import mastermlx as mlx
X = np.random.randn(200, 5)
y = np.where(np.random.randn(200) > 0, 1, 0)
clf = mlx.SGDClassifier(loss="hinge", max_iter=50).fit(X, y)
print(clf.score(X, y))
kmeans = mlx.KMeans(n_clusters=3, random_state=0).fit(X)
print(kmeans.inertia_)
print(mlx.entropy(np.array([0.2, 0.3, 0.5])))
Highlights
- Models: linear models, trees, ensembles, clustering, decomposition, probabilistic methods, neural nets, SVMs, preprocessing, feature selection
- NLP: vectorizers, tokenizers, vocab builders, language models
- RL and bandits: Q-learning, DQN, REINFORCE, UCB, Thompson sampling, and more
- Math tools: metrics, kernels, distributions, statistical tests, calibration, outlier detection, and time-series helpers
Acceleration
The library includes optional compiled helpers for:
- Pairwise distances
- KD-tree search
- Decision tree split search
- Convolution and max pooling
If the compiled backend is missing, mastermlx falls back to the NumPy implementation automatically.
Releases
- Stable releases are published on PyPI:
pip install mastermlx - Release tags and changelogs are published on GitHub
- For maintainers, see
RELEASING.md
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mastermlx-0.1.1.tar.gz.
File metadata
- Download URL: mastermlx-0.1.1.tar.gz
- Upload date:
- Size: 529.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c45a381d238dc39e900799b77cc64bc5cfe20fde65101a6c1df5f92c53886d14
|
|
| MD5 |
ffb3e22c2e79cbfe9977b8aabdc0cf77
|
|
| BLAKE2b-256 |
27047143fc377355bf83ed6e4db4c2186ec960539c96f66076debd2b25edacf7
|
File details
Details for the file mastermlx-0.1.1-cp313-cp313-win_amd64.whl.
File metadata
- Download URL: mastermlx-0.1.1-cp313-cp313-win_amd64.whl
- Upload date:
- Size: 619.0 kB
- Tags: CPython 3.13, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
de98bdf8efded179ce7a2f5cf2dafd1b70c5275cfb52ef8d5deff6ff344f3410
|
|
| MD5 |
01aef10dc65d92ff25cd98bec6ca8730
|
|
| BLAKE2b-256 |
65273038c43645ce91a4a7a6ac9c88572d665ce3368e1354e679f97b2d010bf7
|
File details
Details for the file mastermlx-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: mastermlx-0.1.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.8 MB
- Tags: CPython 3.13, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15ec87b9b33477a7b9f01e62fe75f6aa11b4b92dae3cce4e383fef1d599b7a01
|
|
| MD5 |
9f88fa8807a24bcd4502d72798e71ba7
|
|
| BLAKE2b-256 |
c0435675236798b8cdfbb3d5e5c03c42ce0966d9509b11b87b870d5b72879c0c
|
File details
Details for the file mastermlx-0.1.1-cp313-cp313-macosx_11_0_arm64.whl.
File metadata
- Download URL: mastermlx-0.1.1-cp313-cp313-macosx_11_0_arm64.whl
- Upload date:
- Size: 620.2 kB
- Tags: CPython 3.13, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
69c2899786ffd0150b6e79c2d6db385843448a139c897adb8b8fd4b397d0d9a4
|
|
| MD5 |
857ff206cbb781fa0be5054e9f29e681
|
|
| BLAKE2b-256 |
7b08314bcc35c527649f5fd71ce1872511bb384ff7db2926424c0db88022e352
|
File details
Details for the file mastermlx-0.1.1-cp312-cp312-win_amd64.whl.
File metadata
- Download URL: mastermlx-0.1.1-cp312-cp312-win_amd64.whl
- Upload date:
- Size: 620.8 kB
- Tags: CPython 3.12, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
95ae49145185069ca802599e11ade81efda6c0bb6e089dd32197702bbbe0634c
|
|
| MD5 |
f449fc2724f0d3c089b6755b4fa1bf53
|
|
| BLAKE2b-256 |
3ae53b3d6fcd4661abecb0516255248c1fe8c99e047e77e94b807fe51e7f5f94
|
File details
Details for the file mastermlx-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: mastermlx-0.1.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.9 MB
- Tags: CPython 3.12, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f864f3bc89505d9e0ddb98ffca789aab03da1763ee1a181b71897b802e13930
|
|
| MD5 |
d7e81874a2412b859a3f2a06114f9b22
|
|
| BLAKE2b-256 |
1b72cdd966577060fa365b2eede68ee0429a281e58d4ebb888a0ab9a55fc98fd
|
File details
Details for the file mastermlx-0.1.1-cp312-cp312-macosx_11_0_arm64.whl.
File metadata
- Download URL: mastermlx-0.1.1-cp312-cp312-macosx_11_0_arm64.whl
- Upload date:
- Size: 622.0 kB
- Tags: CPython 3.12, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cd3eb22358ce74ba3fffe5ae3edabb44ee4c02339237b9d7d895115f74866597
|
|
| MD5 |
1bfe15835b03209d21d075c62c5de693
|
|
| BLAKE2b-256 |
1431ba9cffd9d89c3e26a4b89e531bb2487484e728e61733b4f077e61b3abbb5
|
File details
Details for the file mastermlx-0.1.1-cp311-cp311-win_amd64.whl.
File metadata
- Download URL: mastermlx-0.1.1-cp311-cp311-win_amd64.whl
- Upload date:
- Size: 613.1 kB
- Tags: CPython 3.11, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2ea477276716066a70ac3c19a2cbd7fdf9a64a0b569fce9a7664eda8a4c9d24
|
|
| MD5 |
efb4a7463e8ee884958ad18e70cca53f
|
|
| BLAKE2b-256 |
11b702125ac2d179eb6176350bc92ab151e6fb2650a8e9382d57d4d3abd5425c
|
File details
Details for the file mastermlx-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: mastermlx-0.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.8 MB
- Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b4b1fedffb60795687b35190d3aa4ca621a072e0081f97a0c5fd112f46d6cc09
|
|
| MD5 |
25f0aecbf19b3b6a90bdea75d5ed72b0
|
|
| BLAKE2b-256 |
50e661ddc6cddc723c3ae6095f7440cd9ab16cd6e8333e60fc3be5aed6311bf9
|
File details
Details for the file mastermlx-0.1.1-cp311-cp311-macosx_11_0_arm64.whl.
File metadata
- Download URL: mastermlx-0.1.1-cp311-cp311-macosx_11_0_arm64.whl
- Upload date:
- Size: 617.5 kB
- Tags: CPython 3.11, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c5097da440440705515a26fba0f1d417d83c4aa6cf5afc8700cf9c6523358046
|
|
| MD5 |
76ab4687b1f78c128d91909a90bec766
|
|
| BLAKE2b-256 |
22da7b58d33f4d66396f5d3a00b48f9db36809bac865bd5fe21ccef5b6d114d0
|
File details
Details for the file mastermlx-0.1.1-cp310-cp310-win_amd64.whl.
File metadata
- Download URL: mastermlx-0.1.1-cp310-cp310-win_amd64.whl
- Upload date:
- Size: 611.2 kB
- Tags: CPython 3.10, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86f2111fb6705280bc6e4a6f0918e54a82233b698792e653654af27f7290e82f
|
|
| MD5 |
42906ab7756dc2612a7e629951d55911
|
|
| BLAKE2b-256 |
10c475c6b7a49d711082c6f3da04a6466c9a9db768531643fb17dd237942287d
|
File details
Details for the file mastermlx-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: mastermlx-0.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 4.7 MB
- Tags: CPython 3.10, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
380192dcfc836cb3cce4d806be6ea59a523e68f40b4ff73b201d8213cda13711
|
|
| MD5 |
c8ecc0018a2450a263b2e534bc1c8773
|
|
| BLAKE2b-256 |
f5412f1408acb96b3c6c50b5ee9bef598d316e4c8d62234a5a3b7292a49fc0be
|
File details
Details for the file mastermlx-0.1.1-cp310-cp310-macosx_12_0_arm64.whl.
File metadata
- Download URL: mastermlx-0.1.1-cp310-cp310-macosx_12_0_arm64.whl
- Upload date:
- Size: 582.5 kB
- Tags: CPython 3.10, macOS 12.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.20
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6dab1cb9492e0425c5e0a0c7508a12014fdbe38eb357c0edd0b822c01c8e5cbd
|
|
| MD5 |
1b6c42bbc8f2821539260bda4287fd97
|
|
| BLAKE2b-256 |
ba86e54c0f0e37c4ee5ef3171cd18db40bb835e1527e976f6af9b43509712017
|
File details
Details for the file mastermlx-0.1.1-cp310-cp310-macosx_11_0_arm64.whl.
File metadata
- Download URL: mastermlx-0.1.1-cp310-cp310-macosx_11_0_arm64.whl
- Upload date:
- Size: 615.3 kB
- Tags: CPython 3.10, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f77d1d9b9f7b4a37c90921918dafdbcadf2457c3066572db5990b082d4e0b00a
|
|
| MD5 |
5fe271a2e4b46571a07e39caeab0bb33
|
|
| BLAKE2b-256 |
4a4a3cb7356d86c86be7b00c8a6898b08df7d706949207fc946d3c521fe38d73
|